mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-27 02:19:07 -07:00
Initial commit
This commit is contained in:
59
src/package_35/VectorCodeclongLevel1.as
Normal file
59
src/package_35/VectorCodeclongLevel1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package package_35
|
||||
{
|
||||
import package_32.name_148;
|
||||
import package_33.name_155;
|
||||
import package_34.name_150;
|
||||
import package_36.name_152;
|
||||
import package_36.name_163;
|
||||
import package_36.name_442;
|
||||
import package_38.name_443;
|
||||
|
||||
public class VectorCodeclongLevel1 implements name_152
|
||||
{
|
||||
private var elementCodec:name_152;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodeclongLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:name_163) : void
|
||||
{
|
||||
this.elementCodec = protocol.name_448(new name_148(name_155,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new name_150(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function method_296(protocolBuffer:name_442) : Object
|
||||
{
|
||||
var length:int = name_443.name_445(protocolBuffer);
|
||||
var result:Vector.<name_155> = new Vector.<name_155>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = name_155(this.elementCodec.method_296(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function method_295(protocolBuffer:name_442, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<name_155> = Vector.<name_155>(object);
|
||||
var length:int = int(data.length);
|
||||
name_443.name_446(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.method_295(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user