home *** CD-ROM | disk | FTP | other *** search
- package ENGINE.CORE
- {
- import flash.utils.ByteArray;
-
- public dynamic class OCache
- {
-
-
- public function OCache()
- {
- super();
- }
-
- public function Pack() : ByteArray
- {
- var _loc1_:ByteArray = null;
- _loc1_ = new ByteArray();
- _loc1_.writeObject(this);
- _loc1_.compress();
- return _loc1_;
- }
-
- public function AddCategoryArr(param1:String, param2:String) : Array
- {
- var _loc3_:OCache = null;
- _loc3_ = this[param1] == undefined ? AddCategory(param1) : this[param1];
- return _loc3_.AddArr(param2);
- }
-
- public function GetArrItem(param1:String, param2:int) : *
- {
- if(this[param1] == undefined || this[param1][param2] == undefined)
- {
- return null;
- }
- return this[param1][param2];
- }
-
- public function DeleteArrItem(param1:String, param2:int) : void
- {
- if(this[param1] == undefined)
- {
- return;
- }
- this[param1].splice(param2,1);
- }
-
- public function IsCategoryArrItem(param1:String, param2:String, param3:int) : Boolean
- {
- if(this[param1] == undefined)
- {
- return false;
- }
- return this[param1].IsArrItem(param2,param3);
- }
-
- public function GetCategoryItem(param1:String, param2:String) : *
- {
- if(this[param1] == undefined)
- {
- return null;
- }
- return this[param1].GetItem(param2);
- }
-
- public function SetCategoryItem(param1:String, param2:String, param3:*) : void
- {
- if(this[param1] == undefined)
- {
- this[param1] = new OCache();
- }
- this[param1].SetItem(param2,param3);
- }
-
- public function SetCategoryArrItem(param1:String, param2:String, param3:int, param4:*) : void
- {
- if(this[param1] == undefined)
- {
- this[param1] = new OCache();
- }
- this[param1].SetArrItem(param2,param3,param4);
- }
-
- public function IsCategoryItem(param1:String, param2:String) : Boolean
- {
- if(this[param1] == undefined)
- {
- return false;
- }
- return this[param1].IsItem(param2);
- }
-
- public function DeleteCategoryItem(param1:String, param2:String) : void
- {
- if(this[param1] == undefined)
- {
- return;
- }
- this[param1].DeleteItem(param2);
- }
-
- public function AddCategory(param1:String) : OCache
- {
- this[param1] = new OCache();
- return this[param1];
- }
-
- public function GetCategoryArrItem(param1:String, param2:String, param3:int) : *
- {
- if(this[param1] == undefined)
- {
- return null;
- }
- return GetArrItem(param2,param3);
- }
-
- public function GetCategoryNames(param1:String) : Array
- {
- var _loc2_:Array = null;
- var _loc3_:String = null;
- if(this[param1] == undefined)
- {
- return null;
- }
- _loc2_ = new Array();
- for(_loc3_ in this[param1])
- {
- _loc2_.push(_loc3_);
- }
- return !!_loc2_.length ? _loc2_.sort() : null;
- }
-
- public function AddArr(param1:String) : Array
- {
- this[param1] = new Array();
- return this[param1];
- }
-
- public function GetItem(param1:String) : *
- {
- if(this[param1] == undefined)
- {
- return null;
- }
- return this[param1];
- }
-
- public function IsArrItem(param1:String, param2:int) : Boolean
- {
- return this[param1] != undefined && this[param1][param2] != undefined;
- }
-
- public function DeleteCategoryArrItem(param1:String, param2:String, param3:int) : void
- {
- if(this[param1] == undefined)
- {
- return;
- }
- this[param1].DeleteArrItem(param2,param3);
- }
-
- public function Clear() : void
- {
- var _loc1_:String = null;
- for(_loc1_ in this)
- {
- delete this[_loc1_];
- }
- }
-
- public function SetArrItem(param1:String, param2:int, param3:*) : void
- {
- if(this[param1] == undefined)
- {
- this[param1] = new Array();
- }
- this[param1][param2] = param3;
- }
-
- public function SetItem(param1:String, param2:*) : void
- {
- this[param1] = param2;
- }
-
- public function GetNames() : Array
- {
- var _loc1_:Array = null;
- var _loc2_:String = null;
- _loc1_ = new Array();
- for(_loc2_ in this)
- {
- _loc1_.push(_loc2_);
- }
- return !!_loc1_.length ? _loc1_.sort() : null;
- }
-
- public function IsItem(param1:String) : Boolean
- {
- return this[param1] != undefined;
- }
-
- public function DeleteItem(param1:String) : void
- {
- if(this[param1] == undefined)
- {
- return;
- }
- delete this[param1];
- }
- }
- }
-