home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Acao / midnightstrike1.swf / scripts / __Packages / com / neodelight / std / Blueprint.as next >
Encoding:
Text File  |  2007-04-02  |  1.2 KB  |  54 lines

  1. class com.neodelight.std.Blueprint
  2. {
  3.    static var lib = new Array();
  4.    function Blueprint()
  5.    {
  6.    }
  7.    static function addBlueprint(id, o)
  8.    {
  9.       com.neodelight.std.Blueprint.lib[id] = o;
  10.    }
  11.    static function getBlueprint(id)
  12.    {
  13.       if(typeof id == "object")
  14.       {
  15.          return id;
  16.       }
  17.       var _loc1_ = com.neodelight.std.Blueprint.lib[id];
  18.       if(_loc1_.blueprint)
  19.       {
  20.          com.neodelight.std.Blueprint.apply(_loc1_,_loc1_.blueprint);
  21.       }
  22.       return _loc1_;
  23.    }
  24.    static function apply(target, id)
  25.    {
  26.       if(!id)
  27.       {
  28.          id = String(target.blueprint);
  29.       }
  30.       var _loc3_ = com.neodelight.std.Blueprint.lib[id];
  31.       for(var _loc1_ in _loc3_)
  32.       {
  33.          if(_loc1_ != "blueprint")
  34.          {
  35.             if(target[_loc1_] == undefined)
  36.             {
  37.                target[_loc1_] = _loc3_[_loc1_];
  38.             }
  39.          }
  40.       }
  41.       if(_loc3_.blueprint)
  42.       {
  43.          var _loc4_ = _loc3_.blueprint.split(",");
  44.          var _loc1_ = 0;
  45.          while(_loc1_ < _loc4_.length)
  46.          {
  47.             com.neodelight.std.Blueprint.apply(target,_loc4_[_loc1_]);
  48.             _loc1_ = _loc1_ + 1;
  49.          }
  50.       }
  51.       return target;
  52.    }
  53. }
  54.