home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / starisland.swf / scripts / __Packages / huang / HighList.as < prev    next >
Encoding:
Text File  |  2007-12-10  |  1.5 KB  |  63 lines

  1. class huang.HighList
  2. {
  3.    var items;
  4.    function HighList(ListLength, initValue)
  5.    {
  6.       this.items = new Array(ListLength);
  7.       if(initValue != undefined)
  8.       {
  9.          var _loc2_ = 0;
  10.          _loc2_ = 0;
  11.          while(_loc2_ < ListLength)
  12.          {
  13.             this.items[_loc2_] = initValue;
  14.             _loc2_ = _loc2_ + 1;
  15.          }
  16.       }
  17.    }
  18.    function Sortby(filed)
  19.    {
  20.       if(this.items.length > 0)
  21.       {
  22.          this.items.sortOn(filed,Array.DESCENDING | Array.NUMERIC);
  23.       }
  24.    }
  25.    function Insert(yourItem, compare)
  26.    {
  27.       if(this.items.length > 0)
  28.       {
  29.          this.Sortby(compare);
  30.          var _loc2_ = 0;
  31.          while(_loc2_ < this.items.length)
  32.          {
  33.             if(int(yourItem[compare]) >= int(this.items[_loc2_][compare]))
  34.             {
  35.                this.items[this.items.length - 1] = yourItem;
  36.                this.Sortby(compare);
  37.                return _loc2_;
  38.             }
  39.             _loc2_ = _loc2_ + 1;
  40.          }
  41.          return -1;
  42.       }
  43.       this.items[0] = yourItem;
  44.       return 0;
  45.    }
  46.    function getIndex(yourNum, ToBeCheckNum)
  47.    {
  48.       if(this.items.length > 0)
  49.       {
  50.          var _loc2_ = 0;
  51.          while(_loc2_ < this.items.length)
  52.          {
  53.             if(yourNum < this.items[_loc2_].ToBeCheckNum)
  54.             {
  55.             }
  56.             _loc2_ = _loc2_ + 1;
  57.          }
  58.       }
  59.       this.items[0] = yourNum;
  60.       return 0;
  61.    }
  62. }
  63.