mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-26 18:09:07 -07:00
60 lines
1.8 KiB
ActionScript
60 lines
1.8 KiB
ActionScript
package package_59
|
|
{
|
|
import package_32.name_148;
|
|
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;
|
|
import package_53.A3DMaterial;
|
|
|
|
public class VectorCodecA3DMaterialLevel1 implements name_152
|
|
{
|
|
private var elementCodec:name_152;
|
|
|
|
private var optionalElement:Boolean;
|
|
|
|
public function VectorCodecA3DMaterialLevel1(optionalElement:Boolean)
|
|
{
|
|
super();
|
|
this.optionalElement = optionalElement;
|
|
}
|
|
|
|
public function init(protocol:name_163) : void
|
|
{
|
|
this.elementCodec = protocol.name_448(new name_148(A3DMaterial,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.<A3DMaterial> = new Vector.<A3DMaterial>(length,true);
|
|
for(var i:int = 0; i < length; i++)
|
|
{
|
|
result[i] = A3DMaterial(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.<A3DMaterial> = Vector.<A3DMaterial>(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]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|