mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-26 18:09:07 -07:00
Add mostly deobfuscated package, class and function name source
This commit is contained in:
83
src/_codec/versions/version1/a3d/CodecA3D.as
Normal file
83
src/_codec/versions/version1/a3d/CodecA3D.as
Normal file
@@ -0,0 +1,83 @@
|
||||
package _codec.versions.version1.a3d
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.CollectionCodecInfo;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.A3D;
|
||||
import versions.version1.a3d.geometry.A3DGeometry;
|
||||
import versions.version1.a3d.materials.A3DImage;
|
||||
import versions.version1.a3d.materials.A3DMap;
|
||||
import versions.version1.a3d.materials.A3DMaterial;
|
||||
import versions.version1.a3d.objects.A3DBox;
|
||||
import versions.version1.a3d.objects.A3DObject;
|
||||
|
||||
public class CodecA3D implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-EA§:ICodec;
|
||||
|
||||
private var §_-PA§:ICodec;
|
||||
|
||||
private var §_-Sd§:ICodec;
|
||||
|
||||
private var §_-dB§:ICodec;
|
||||
|
||||
private var §_-77§:ICodec;
|
||||
|
||||
private var §_-1x§:ICodec;
|
||||
|
||||
public function CodecA3D()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-EA§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DBox,false),true,1));
|
||||
this.§_-PA§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DGeometry,false),true,1));
|
||||
this.§_-Sd§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DImage,false),true,1));
|
||||
this.§_-dB§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DMap,false),true,1));
|
||||
this.§_-77§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DMaterial,false),true,1));
|
||||
this.§_-1x§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DObject,false),true,1));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_boxes:Vector.<A3DBox> = this.§_-EA§.decode(protocolBuffer) as Vector.<A3DBox>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","boxes",value_boxes);
|
||||
var value_geometries:Vector.<A3DGeometry> = this.§_-PA§.decode(protocolBuffer) as Vector.<A3DGeometry>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","geometries",value_geometries);
|
||||
var value_images:Vector.<A3DImage> = this.§_-Sd§.decode(protocolBuffer) as Vector.<A3DImage>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","images",value_images);
|
||||
var value_maps:Vector.<A3DMap> = this.§_-dB§.decode(protocolBuffer) as Vector.<A3DMap>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","maps",value_maps);
|
||||
var value_materials:Vector.<A3DMaterial> = this.§_-77§.decode(protocolBuffer) as Vector.<A3DMaterial>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","materials",value_materials);
|
||||
var value_objects:Vector.<A3DObject> = this.§_-1x§.decode(protocolBuffer) as Vector.<A3DObject>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.A3D","objects",value_objects);
|
||||
return new A3D(value_boxes,value_geometries,value_images,value_maps,value_materials,value_objects);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D = A3D(object);
|
||||
this.§_-EA§.encode(protocolBuffer,struct.boxes);
|
||||
this.§_-PA§.encode(protocolBuffer,struct.geometries);
|
||||
this.§_-Sd§.encode(protocolBuffer,struct.images);
|
||||
this.§_-dB§.encode(protocolBuffer,struct.maps);
|
||||
this.§_-77§.encode(protocolBuffer,struct.materials);
|
||||
this.§_-1x§.encode(protocolBuffer,struct.objects);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
src/_codec/versions/version1/a3d/VectorCodecA3DLevel1.as
Normal file
59
src/_codec/versions/version1/a3d/VectorCodecA3DLevel1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.A3D;
|
||||
|
||||
public class VectorCodecA3DLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3D> = new Vector.<A3D>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3D> = Vector.<A3D>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
89
src/_codec/versions/version1/a3d/VectorCodecA3DLevel2.as
Normal file
89
src/_codec/versions/version1/a3d/VectorCodecA3DLevel2.as
Normal file
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.A3D;
|
||||
|
||||
public class VectorCodecA3DLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D>> = new Vector.<Vector.<A3D>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3D>> = Vector.<Vector.<A3D>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
119
src/_codec/versions/version1/a3d/VectorCodecA3DLevel3.as
Normal file
119
src/_codec/versions/version1/a3d/VectorCodecA3DLevel3.as
Normal file
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.A3D;
|
||||
|
||||
public class VectorCodecA3DLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D>>> = new Vector.<Vector.<Vector.<A3D>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3D>>> = Vector.<Vector.<Vector.<A3D>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.CollectionCodecInfo;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
import versions.version1.a3d.geometry.A3DGeometry;
|
||||
import versions.version1.a3d.geometry.A3DIndexBuffer;
|
||||
import versions.version1.a3d.geometry.A3DVertexBuffer;
|
||||
|
||||
public class CodecA3DGeometry implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-XF§:ICodec;
|
||||
|
||||
private var §_-U9§:ICodec;
|
||||
|
||||
public function CodecA3DGeometry()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-XF§ = protocol.getCodec(new TypeCodecInfo(A3DIndexBuffer,true));
|
||||
this.§_-U9§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DVertexBuffer,false),true,1));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DGeometry","id",value_id);
|
||||
var value_indexBuffer:A3DIndexBuffer = this.§_-XF§.decode(protocolBuffer) as A3DIndexBuffer;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DGeometry","indexBuffer",value_indexBuffer);
|
||||
var value_vertexBuffers:Vector.<A3DVertexBuffer> = this.§_-U9§.decode(protocolBuffer) as Vector.<A3DVertexBuffer>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DGeometry","vertexBuffers",value_vertexBuffers);
|
||||
return new A3DGeometry(value_id,value_indexBuffer,value_vertexBuffers);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DGeometry = A3DGeometry(object);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-XF§.encode(protocolBuffer,struct.indexBuffer);
|
||||
this.§_-U9§.encode(protocolBuffer,struct.vertexBuffers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import flash.utils.ByteArray;
|
||||
import versions.version1.a3d.geometry.A3DIndexBuffer;
|
||||
|
||||
public class CodecA3DIndexBuffer implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-GN§:ICodec;
|
||||
|
||||
private var §_-mz§:ICodec;
|
||||
|
||||
public function CodecA3DIndexBuffer()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-GN§ = protocol.getCodec(new TypeCodecInfo(ByteArray,true));
|
||||
this.§_-mz§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_byteBuffer:ByteArray = this.§_-GN§.decode(protocolBuffer) as ByteArray;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DIndexBuffer","byteBuffer",value_byteBuffer);
|
||||
var value_indexCount:int = int(this.§_-mz§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DIndexBuffer","indexCount",value_indexCount);
|
||||
return new A3DIndexBuffer(value_byteBuffer,value_indexCount);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DIndexBuffer = A3DIndexBuffer(object);
|
||||
this.§_-GN§.encode(protocolBuffer,struct.byteBuffer);
|
||||
this.§_-mz§.encode(protocolBuffer,struct.indexCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.CollectionCodecInfo;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Byte;
|
||||
import alternativa.types.UShort;
|
||||
import flash.utils.ByteArray;
|
||||
import versions.version1.a3d.geometry.A3DVertexBuffer;
|
||||
|
||||
public class CodecA3DVertexBuffer implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Lj§:ICodec;
|
||||
|
||||
private var §_-GN§:ICodec;
|
||||
|
||||
private var §_-hc§:ICodec;
|
||||
|
||||
public function CodecA3DVertexBuffer()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Lj§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Byte,false),true,1));
|
||||
this.§_-GN§ = protocol.getCodec(new TypeCodecInfo(ByteArray,true));
|
||||
this.§_-hc§ = protocol.getCodec(new TypeCodecInfo(UShort,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_attributes:Vector.<int> = this.§_-Lj§.decode(protocolBuffer) as Vector.<int>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DVertexBuffer","attributes",value_attributes);
|
||||
var value_byteBuffer:ByteArray = this.§_-GN§.decode(protocolBuffer) as ByteArray;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DVertexBuffer","byteBuffer",value_byteBuffer);
|
||||
var value_vertexCount:uint = uint(this.§_-hc§.decode(protocolBuffer) as uint);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.geometry.A3DVertexBuffer","vertexCount",value_vertexCount);
|
||||
return new A3DVertexBuffer(value_attributes,value_byteBuffer,value_vertexCount);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DVertexBuffer = A3DVertexBuffer(object);
|
||||
this.§_-Lj§.encode(protocolBuffer,struct.attributes);
|
||||
this.§_-GN§.encode(protocolBuffer,struct.byteBuffer);
|
||||
this.§_-hc§.encode(protocolBuffer,struct.vertexCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DGeometry;
|
||||
|
||||
public class VectorCodecA3DGeometryLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DGeometryLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DGeometry,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DGeometry> = new Vector.<A3DGeometry>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DGeometry(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DGeometry> = Vector.<A3DGeometry>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DGeometry;
|
||||
|
||||
public class VectorCodecA3DGeometryLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DGeometryLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DGeometry,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DGeometry> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DGeometry>> = new Vector.<Vector.<A3DGeometry>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DGeometry>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DGeometry(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DGeometry> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DGeometry>> = Vector.<Vector.<A3DGeometry>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DGeometry;
|
||||
|
||||
public class VectorCodecA3DGeometryLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DGeometryLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DGeometry,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DGeometry>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DGeometry> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DGeometry>>> = new Vector.<Vector.<Vector.<A3DGeometry>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DGeometry>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DGeometry>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DGeometry(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DGeometry>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DGeometry> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DGeometry>>> = Vector.<Vector.<Vector.<A3DGeometry>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DIndexBuffer;
|
||||
|
||||
public class VectorCodecA3DIndexBufferLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DIndexBufferLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DIndexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DIndexBuffer> = new Vector.<A3DIndexBuffer>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DIndexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DIndexBuffer> = Vector.<A3DIndexBuffer>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DIndexBuffer;
|
||||
|
||||
public class VectorCodecA3DIndexBufferLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DIndexBufferLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DIndexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DIndexBuffer> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DIndexBuffer>> = new Vector.<Vector.<A3DIndexBuffer>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DIndexBuffer>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DIndexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DIndexBuffer> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DIndexBuffer>> = Vector.<Vector.<A3DIndexBuffer>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DIndexBuffer;
|
||||
|
||||
public class VectorCodecA3DIndexBufferLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DIndexBufferLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DIndexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DIndexBuffer>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DIndexBuffer> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DIndexBuffer>>> = new Vector.<Vector.<Vector.<A3DIndexBuffer>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DIndexBuffer>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DIndexBuffer>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DIndexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DIndexBuffer>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DIndexBuffer> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DIndexBuffer>>> = Vector.<Vector.<Vector.<A3DIndexBuffer>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DVertexBuffer;
|
||||
|
||||
public class VectorCodecA3DVertexBufferLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DVertexBufferLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DVertexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DVertexBuffer> = new Vector.<A3DVertexBuffer>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DVertexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DVertexBuffer> = Vector.<A3DVertexBuffer>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DVertexBuffer;
|
||||
|
||||
public class VectorCodecA3DVertexBufferLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DVertexBufferLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DVertexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DVertexBuffer> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DVertexBuffer>> = new Vector.<Vector.<A3DVertexBuffer>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DVertexBuffer>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DVertexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DVertexBuffer> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DVertexBuffer>> = Vector.<Vector.<A3DVertexBuffer>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.geometry.A3DVertexBuffer;
|
||||
|
||||
public class VectorCodecA3DVertexBufferLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DVertexBufferLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DVertexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DVertexBuffer>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DVertexBuffer> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DVertexBuffer>>> = new Vector.<Vector.<Vector.<A3DVertexBuffer>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DVertexBuffer>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DVertexBuffer>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DVertexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DVertexBuffer>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DVertexBuffer> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DVertexBuffer>>> = Vector.<Vector.<Vector.<A3DVertexBuffer>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
46
src/_codec/versions/version1/a3d/id/CodecParentId.as
Normal file
46
src/_codec/versions/version1/a3d/id/CodecParentId.as
Normal file
@@ -0,0 +1,46 @@
|
||||
package _codec.versions.version1.a3d.id
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.id.ParentId;
|
||||
|
||||
public class CodecParentId implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
public function CodecParentId()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(uint,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_id:uint = uint(this.§_-2o§.decode(protocolBuffer) as uint);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.id.ParentId","id",value_id);
|
||||
return new ParentId(value_id);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:ParentId = ParentId(object);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.id
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.id.ParentId;
|
||||
|
||||
public class VectorCodecParentIdLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecParentIdLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(ParentId,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<ParentId> = new Vector.<ParentId>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = ParentId(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<ParentId> = Vector.<ParentId>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.id
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.id.ParentId;
|
||||
|
||||
public class VectorCodecParentIdLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecParentIdLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(ParentId,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<ParentId> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<ParentId>> = new Vector.<Vector.<ParentId>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<ParentId>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = ParentId(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<ParentId> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<ParentId>> = Vector.<Vector.<ParentId>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
119
src/_codec/versions/version1/a3d/id/VectorCodecParentIdLevel3.as
Normal file
119
src/_codec/versions/version1/a3d/id/VectorCodecParentIdLevel3.as
Normal file
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.id
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.id.ParentId;
|
||||
|
||||
public class VectorCodecParentIdLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecParentIdLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(ParentId,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<ParentId>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<ParentId> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<ParentId>>> = new Vector.<Vector.<Vector.<ParentId>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<ParentId>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<ParentId>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = ParentId(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<ParentId>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<ParentId> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<ParentId>>> = Vector.<Vector.<Vector.<ParentId>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
53
src/_codec/versions/version1/a3d/materials/CodecA3DImage.as
Normal file
53
src/_codec/versions/version1/a3d/materials/CodecA3DImage.as
Normal file
@@ -0,0 +1,53 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
import versions.version1.a3d.materials.A3DImage;
|
||||
|
||||
public class CodecA3DImage implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-aV§:ICodec;
|
||||
|
||||
public function CodecA3DImage()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-aV§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DImage","id",value_id);
|
||||
var value_url:String = this.§_-aV§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DImage","url",value_url);
|
||||
return new A3DImage(value_id,value_url);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DImage = A3DImage(object);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-aV§.encode(protocolBuffer,struct.url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
85
src/_codec/versions/version1/a3d/materials/CodecA3DMap.as
Normal file
85
src/_codec/versions/version1/a3d/materials/CodecA3DMap.as
Normal file
@@ -0,0 +1,85 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Float;
|
||||
import alternativa.types.UShort;
|
||||
import commons.Id;
|
||||
import versions.version1.a3d.materials.A3DMap;
|
||||
|
||||
public class CodecA3DMap implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-mC§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-2N§:ICodec;
|
||||
|
||||
private var §_-K5§:ICodec;
|
||||
|
||||
private var §_-Q5§:ICodec;
|
||||
|
||||
private var §_-WH§:ICodec;
|
||||
|
||||
private var §_-kh§:ICodec;
|
||||
|
||||
public function CodecA3DMap()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-mC§ = protocol.getCodec(new TypeCodecInfo(UShort,false));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-2N§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-K5§ = protocol.getCodec(new TypeCodecInfo(Float,true));
|
||||
this.§_-Q5§ = protocol.getCodec(new TypeCodecInfo(Float,true));
|
||||
this.§_-WH§ = protocol.getCodec(new TypeCodecInfo(Float,true));
|
||||
this.§_-kh§ = protocol.getCodec(new TypeCodecInfo(Float,true));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_channel:uint = uint(this.§_-mC§.decode(protocolBuffer) as uint);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","channel",value_channel);
|
||||
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","id",value_id);
|
||||
var value_imageId:Id = this.§_-2N§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","imageId",value_imageId);
|
||||
var value_uOffset:Number = Number(this.§_-K5§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","uOffset",value_uOffset);
|
||||
var value_uScale:Number = Number(this.§_-Q5§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","uScale",value_uScale);
|
||||
var value_vOffset:Number = Number(this.§_-WH§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","vOffset",value_vOffset);
|
||||
var value_vScale:Number = Number(this.§_-kh§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMap","vScale",value_vScale);
|
||||
return new A3DMap(value_channel,value_id,value_imageId,value_uOffset,value_uScale,value_vOffset,value_vScale);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DMap = A3DMap(object);
|
||||
this.§_-mC§.encode(protocolBuffer,struct.channel);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-2N§.encode(protocolBuffer,struct.imageId);
|
||||
this.§_-K5§.encode(protocolBuffer,struct.uOffset);
|
||||
this.§_-Q5§.encode(protocolBuffer,struct.uScale);
|
||||
this.§_-WH§.encode(protocolBuffer,struct.vOffset);
|
||||
this.§_-kh§.encode(protocolBuffer,struct.vScale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
import versions.version1.a3d.materials.A3DMaterial;
|
||||
|
||||
public class CodecA3DMaterial implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-9A§:ICodec;
|
||||
|
||||
private var §_-hw§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-Hu§:ICodec;
|
||||
|
||||
private var §_-GK§:ICodec;
|
||||
|
||||
private var §_-LZ§:ICodec;
|
||||
|
||||
private var §_-FU§:ICodec;
|
||||
|
||||
public function CodecA3DMaterial()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-9A§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-hw§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-Hu§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-GK§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-LZ§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-FU§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_diffuseMapId:Id = this.§_-9A§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","diffuseMapId",value_diffuseMapId);
|
||||
var value_glossinessMapId:Id = this.§_-hw§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","glossinessMapId",value_glossinessMapId);
|
||||
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","id",value_id);
|
||||
var value_lightMapId:Id = this.§_-Hu§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","lightMapId",value_lightMapId);
|
||||
var value_normalMapId:Id = this.§_-GK§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","normalMapId",value_normalMapId);
|
||||
var value_opacityMapId:Id = this.§_-LZ§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","opacityMapId",value_opacityMapId);
|
||||
var value_specularMapId:Id = this.§_-FU§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.materials.A3DMaterial","specularMapId",value_specularMapId);
|
||||
return new A3DMaterial(value_diffuseMapId,value_glossinessMapId,value_id,value_lightMapId,value_normalMapId,value_opacityMapId,value_specularMapId);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DMaterial = A3DMaterial(object);
|
||||
this.§_-9A§.encode(protocolBuffer,struct.diffuseMapId);
|
||||
this.§_-hw§.encode(protocolBuffer,struct.glossinessMapId);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-Hu§.encode(protocolBuffer,struct.lightMapId);
|
||||
this.§_-GK§.encode(protocolBuffer,struct.normalMapId);
|
||||
this.§_-LZ§.encode(protocolBuffer,struct.opacityMapId);
|
||||
this.§_-FU§.encode(protocolBuffer,struct.specularMapId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DImage;
|
||||
|
||||
public class VectorCodecA3DImageLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DImageLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DImage,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DImage> = new Vector.<A3DImage>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DImage(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DImage> = Vector.<A3DImage>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DImage;
|
||||
|
||||
public class VectorCodecA3DImageLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DImageLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DImage,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DImage> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DImage>> = new Vector.<Vector.<A3DImage>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DImage>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DImage(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DImage> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DImage>> = Vector.<Vector.<A3DImage>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DImage;
|
||||
|
||||
public class VectorCodecA3DImageLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DImageLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DImage,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DImage>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DImage> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DImage>>> = new Vector.<Vector.<Vector.<A3DImage>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DImage>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DImage>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DImage(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DImage>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DImage> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DImage>>> = Vector.<Vector.<Vector.<A3DImage>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DMap;
|
||||
|
||||
public class VectorCodecA3DMapLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMapLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMap,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DMap> = new Vector.<A3DMap>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DMap(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DMap> = Vector.<A3DMap>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DMap;
|
||||
|
||||
public class VectorCodecA3DMapLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMapLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMap,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DMap> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DMap>> = new Vector.<Vector.<A3DMap>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DMap>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DMap(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DMap> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DMap>> = Vector.<Vector.<A3DMap>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DMap;
|
||||
|
||||
public class VectorCodecA3DMapLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMapLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMap,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DMap>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DMap> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DMap>>> = new Vector.<Vector.<Vector.<A3DMap>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DMap>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DMap>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DMap(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DMap>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DMap> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DMap>>> = Vector.<Vector.<Vector.<A3DMap>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DMaterial;
|
||||
|
||||
public class VectorCodecA3DMaterialLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMaterialLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMaterial,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DMaterial> = new Vector.<A3DMaterial>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DMaterial(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, 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);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DMaterial;
|
||||
|
||||
public class VectorCodecA3DMaterialLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMaterialLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMaterial,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DMaterial> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DMaterial>> = new Vector.<Vector.<A3DMaterial>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DMaterial>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DMaterial(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DMaterial> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DMaterial>> = Vector.<Vector.<A3DMaterial>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.materials
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.materials.A3DMaterial;
|
||||
|
||||
public class VectorCodecA3DMaterialLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DMaterialLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DMaterial,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DMaterial>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DMaterial> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DMaterial>>> = new Vector.<Vector.<Vector.<A3DMaterial>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DMaterial>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DMaterial>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DMaterial(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DMaterial>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DMaterial> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DMaterial>>> = Vector.<Vector.<Vector.<A3DMaterial>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
55
src/_codec/versions/version1/a3d/objects/CodecA3DBox.as
Normal file
55
src/_codec/versions/version1/a3d/objects/CodecA3DBox.as
Normal file
@@ -0,0 +1,55 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.CollectionCodecInfo;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.Float;
|
||||
import commons.Id;
|
||||
import versions.version1.a3d.objects.A3DBox;
|
||||
|
||||
public class CodecA3DBox implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-pM§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
public function CodecA3DBox()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-pM§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Float,false),true,1));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_box:Vector.<Number> = this.§_-pM§.decode(protocolBuffer) as Vector.<Number>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DBox","box",value_box);
|
||||
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DBox","id",value_id);
|
||||
return new A3DBox(value_box,value_id);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DBox = A3DBox(object);
|
||||
this.§_-pM§.encode(protocolBuffer,struct.box);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
93
src/_codec/versions/version1/a3d/objects/CodecA3DObject.as
Normal file
93
src/_codec/versions/version1/a3d/objects/CodecA3DObject.as
Normal file
@@ -0,0 +1,93 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.CollectionCodecInfo;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
import versions.version1.a3d.id.ParentId;
|
||||
import versions.version1.a3d.objects.A3DObject;
|
||||
import versions.version1.a3d.objects.A3DSurface;
|
||||
import versions.version1.a3d.objects.A3DTransformation;
|
||||
|
||||
public class CodecA3DObject implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Dh§:ICodec;
|
||||
|
||||
private var §_-e§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-XW§:ICodec;
|
||||
|
||||
private var §_-jk§:ICodec;
|
||||
|
||||
private var §_-Qr§:ICodec;
|
||||
|
||||
private var §_-9u§:ICodec;
|
||||
|
||||
private var §_-h9§:ICodec;
|
||||
|
||||
public function CodecA3DObject()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Dh§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-e§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
this.§_-jk§ = protocol.getCodec(new TypeCodecInfo(ParentId,true));
|
||||
this.§_-Qr§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3DSurface,false),true,1));
|
||||
this.§_-9u§ = protocol.getCodec(new TypeCodecInfo(A3DTransformation,true));
|
||||
this.§_-h9§ = protocol.getCodec(new TypeCodecInfo(Boolean,true));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_boundBoxId:Id = this.§_-Dh§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","boundBoxId",value_boundBoxId);
|
||||
var value_geometryId:Id = this.§_-e§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","geometryId",value_geometryId);
|
||||
var value_id:Id = this.§_-2o§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","id",value_id);
|
||||
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","name",value_name);
|
||||
var value_parentId:ParentId = this.§_-jk§.decode(protocolBuffer) as ParentId;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","parentId",value_parentId);
|
||||
var value_surfaces:Vector.<A3DSurface> = this.§_-Qr§.decode(protocolBuffer) as Vector.<A3DSurface>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","surfaces",value_surfaces);
|
||||
var value_transformation:A3DTransformation = this.§_-9u§.decode(protocolBuffer) as A3DTransformation;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","transformation",value_transformation);
|
||||
var value_visible:Boolean = Boolean(this.§_-h9§.decode(protocolBuffer) as Boolean);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DObject","visible",value_visible);
|
||||
return new A3DObject(value_boundBoxId,value_geometryId,value_id,value_name,value_parentId,value_surfaces,value_transformation,value_visible);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DObject = A3DObject(object);
|
||||
this.§_-Dh§.encode(protocolBuffer,struct.boundBoxId);
|
||||
this.§_-e§.encode(protocolBuffer,struct.geometryId);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-XW§.encode(protocolBuffer,struct.name);
|
||||
this.§_-jk§.encode(protocolBuffer,struct.parentId);
|
||||
this.§_-Qr§.encode(protocolBuffer,struct.surfaces);
|
||||
this.§_-9u§.encode(protocolBuffer,struct.transformation);
|
||||
this.§_-h9§.encode(protocolBuffer,struct.visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
src/_codec/versions/version1/a3d/objects/CodecA3DSurface.as
Normal file
59
src/_codec/versions/version1/a3d/objects/CodecA3DSurface.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.Id;
|
||||
import versions.version1.a3d.objects.A3DSurface;
|
||||
|
||||
public class CodecA3DSurface implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-AL§:ICodec;
|
||||
|
||||
private var §_-Av§:ICodec;
|
||||
|
||||
private var §_-pJ§:ICodec;
|
||||
|
||||
public function CodecA3DSurface()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-AL§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-Av§ = protocol.getCodec(new TypeCodecInfo(Id,true));
|
||||
this.§_-pJ§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_indexBegin:int = int(this.§_-AL§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DSurface","indexBegin",value_indexBegin);
|
||||
var value_materialId:Id = this.§_-Av§.decode(protocolBuffer) as Id;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DSurface","materialId",value_materialId);
|
||||
var value_numTriangles:int = int(this.§_-pJ§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DSurface","numTriangles",value_numTriangles);
|
||||
return new A3DSurface(value_indexBegin,value_materialId,value_numTriangles);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DSurface = A3DSurface(object);
|
||||
this.§_-AL§.encode(protocolBuffer,struct.indexBegin);
|
||||
this.§_-Av§.encode(protocolBuffer,struct.materialId);
|
||||
this.§_-pJ§.encode(protocolBuffer,struct.numTriangles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.osgi.OSGi;
|
||||
import alternativa.osgi.service.clientlog.IClientLog;
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import commons.A3DMatrix;
|
||||
import versions.version1.a3d.objects.A3DTransformation;
|
||||
|
||||
public class CodecA3DTransformation implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-dG§:ICodec;
|
||||
|
||||
public function CodecA3DTransformation()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-dG§ = protocol.getCodec(new TypeCodecInfo(A3DMatrix,true));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_matrix:A3DMatrix = this.§_-dG§.decode(protocolBuffer) as A3DMatrix;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version1.a3d.objects.A3DTransformation","matrix",value_matrix);
|
||||
return new A3DTransformation(value_matrix);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3DTransformation = A3DTransformation(object);
|
||||
this.§_-dG§.encode(protocolBuffer,struct.matrix);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DBox;
|
||||
|
||||
public class VectorCodecA3DBoxLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DBoxLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DBox,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DBox> = new Vector.<A3DBox>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DBox(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DBox> = Vector.<A3DBox>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DBox;
|
||||
|
||||
public class VectorCodecA3DBoxLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DBoxLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DBox,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DBox> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DBox>> = new Vector.<Vector.<A3DBox>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DBox>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DBox(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DBox> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DBox>> = Vector.<Vector.<A3DBox>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DBox;
|
||||
|
||||
public class VectorCodecA3DBoxLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DBoxLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DBox,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DBox>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DBox> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DBox>>> = new Vector.<Vector.<Vector.<A3DBox>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DBox>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DBox>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DBox(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DBox>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DBox> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DBox>>> = Vector.<Vector.<Vector.<A3DBox>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DObject;
|
||||
|
||||
public class VectorCodecA3DObjectLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DObjectLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DObject,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DObject> = new Vector.<A3DObject>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DObject(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DObject> = Vector.<A3DObject>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DObject;
|
||||
|
||||
public class VectorCodecA3DObjectLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DObjectLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DObject,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DObject> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DObject>> = new Vector.<Vector.<A3DObject>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DObject>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DObject(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DObject> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DObject>> = Vector.<Vector.<A3DObject>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DObject;
|
||||
|
||||
public class VectorCodecA3DObjectLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DObjectLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DObject,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DObject>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DObject> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DObject>>> = new Vector.<Vector.<Vector.<A3DObject>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DObject>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DObject>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DObject(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DObject>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DObject> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DObject>>> = Vector.<Vector.<Vector.<A3DObject>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DSurface;
|
||||
|
||||
public class VectorCodecA3DSurfaceLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DSurfaceLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DSurface,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DSurface> = new Vector.<A3DSurface>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DSurface(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DSurface> = Vector.<A3DSurface>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DSurface;
|
||||
|
||||
public class VectorCodecA3DSurfaceLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DSurfaceLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DSurface,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DSurface> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DSurface>> = new Vector.<Vector.<A3DSurface>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DSurface>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DSurface(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DSurface> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DSurface>> = Vector.<Vector.<A3DSurface>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DSurface;
|
||||
|
||||
public class VectorCodecA3DSurfaceLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DSurfaceLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DSurface,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DSurface>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DSurface> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DSurface>>> = new Vector.<Vector.<Vector.<A3DSurface>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DSurface>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DSurface>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DSurface(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DSurface>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DSurface> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DSurface>>> = Vector.<Vector.<Vector.<A3DSurface>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DTransformation;
|
||||
|
||||
public class VectorCodecA3DTransformationLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DTransformationLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DTransformation,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<A3DTransformation> = new Vector.<A3DTransformation>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3DTransformation(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<A3DTransformation> = Vector.<A3DTransformation>(object);
|
||||
var length:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DTransformation;
|
||||
|
||||
public class VectorCodecA3DTransformationLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DTransformationLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DTransformation,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3DTransformation> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3DTransformation>> = new Vector.<Vector.<A3DTransformation>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3DTransformation>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3DTransformation(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3DTransformation> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<A3DTransformation>> = Vector.<Vector.<A3DTransformation>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items2[i2]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version1.a3d.objects
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import alternativa.protocol.codec.OptionalCodecDecorator;
|
||||
import alternativa.protocol.impl.LengthCodecHelper;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import versions.version1.a3d.objects.A3DTransformation;
|
||||
|
||||
public class VectorCodecA3DTransformationLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3DTransformationLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3DTransformation,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3DTransformation>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3DTransformation> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3DTransformation>>> = new Vector.<Vector.<Vector.<A3DTransformation>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3DTransformation>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3DTransformation>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3DTransformation(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3DTransformation>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3DTransformation> = null;
|
||||
var length3:int = 0;
|
||||
var i3:int = 0;
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var data:Vector.<Vector.<Vector.<A3DTransformation>>> = Vector.<Vector.<Vector.<A3DTransformation>>>(object);
|
||||
var length1:int = int(data.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length1);
|
||||
for(var i1:int = 0; i1 < length1; i1++)
|
||||
{
|
||||
items2 = data[i1];
|
||||
if(items2 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length2 = int(items2.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length2);
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items3 = items2[i1];
|
||||
if(items3 != null)
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(false);
|
||||
length3 = int(items3.length);
|
||||
LengthCodecHelper.encodeLength(protocolBuffer,length3);
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
this.elementCodec.encode(protocolBuffer,items3[i3]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
protocolBuffer.optionalMap.addBit(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user