home *** CD-ROM | disk | FTP | other *** search
- package RES.OBJECTS
- {
- import ENGINE.CORE.OUtils;
-
- public class ORecord
- {
-
- private static var iCount:int = 62;
-
- private static var sAlphabet:String;
-
-
- private var iStr:String;
-
- private var iPos:int;
-
- private var iRecLen:int = 2;
-
- public function ORecord()
- {
- iRecLen = 2;
- super();
- this.iPos = -1;
- }
-
- public static function CodeToInt(param1:String) : int
- {
- return sAlphabet.indexOf(param1.charAt(0)) * iCount + sAlphabet.indexOf(param1.charAt(1));
- }
-
- public function WriteStart() : void
- {
- this.iStr = "";
- this.iPos = 0;
- sAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
- }
-
- public function ReadSmallInt() : int
- {
- var _loc1_:String = null;
- if(this.iPos >= this.iStr.length)
- {
- return -1;
- }
- _loc1_ = this.iStr.substr(this.iPos,1);
- ++this.iPos;
- return sAlphabet.indexOf(_loc1_);
- }
-
- public function ReadTime() : int
- {
- var _loc1_:String = null;
- if(this.iPos >= this.iStr.length)
- {
- return -1;
- }
- _loc1_ = this.iStr.substr(this.iPos,2);
- this.iPos += 2;
- return int(_loc1_);
- }
-
- public function ReadStart() : void
- {
- sAlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
- this.iPos = 0;
- }
-
- public function get prStr() : String
- {
- return this.iStr;
- }
-
- private function IntToCode(param1:int) : String
- {
- var _loc2_:int = 0;
- var _loc3_:int = 0;
- var _loc4_:int = 0;
- _loc2_ = param1 >= iCount * iCount ? iCount * iCount - 1 : param1;
- _loc3_ = _loc2_ % iCount;
- _loc4_ = (_loc2_ - _loc3_) / iCount % iCount;
- return sAlphabet.charAt(_loc4_) + sAlphabet.charAt(_loc3_);
- }
-
- public function ReadFall() : Boolean
- {
- var _loc1_:String = null;
- if(this.iPos >= this.iStr.length)
- {
- return false;
- }
- _loc1_ = this.iStr.substr(this.iPos,1);
- ++this.iPos;
- return int(_loc1_) == 1 ? true : false;
- }
-
- public function WriteNode(param1:int, param2:int, param3:int, param4:int, param5:Boolean, param6:int, param7:int) : void
- {
- if(this.iPos < 0)
- {
- return;
- }
- this.iStr += OUtils.AddZero(param3.toString(),2);
- this.iStr += IntToCode(param1);
- this.iStr += IntToCode(param2);
- this.iStr += sAlphabet.substr(param4,1);
- this.iStr += (param5 ? 1 : 0).toString();
- this.iStr += sAlphabet.substr(param6,1);
- this.iStr += sAlphabet.substr(param7,1);
- }
-
- public function set prStr(param1:String) : void
- {
- this.iStr = param1;
- }
-
- public function ReadCoord() : int
- {
- var _loc1_:String = null;
- if(this.iPos >= this.iStr.length)
- {
- return -1;
- }
- _loc1_ = this.iStr.substr(this.iPos,2);
- this.iPos += 2;
- return CodeToInt(_loc1_);
- }
- }
- }
-