mirror of
https://github.com/MapMakersAndProgrammers/TankiOnline2.0DemoClient.git
synced 2025-10-27 10:29:09 -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
174
src/_codec/versions/version2/a3d/CodecA3D2.as
Normal file
174
src/_codec/versions/version2/a3d/CodecA3D2.as
Normal file
@@ -0,0 +1,174 @@
|
||||
package _codec.versions.version2.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.version2.a3d.A3D2;
|
||||
import versions.version2.a3d.animation.A3D2AnimationClip;
|
||||
import versions.version2.a3d.animation.A3D2Track;
|
||||
import versions.version2.a3d.geometry.A3D2IndexBuffer;
|
||||
import versions.version2.a3d.geometry.A3D2VertexBuffer;
|
||||
import versions.version2.a3d.materials.A3D2CubeMap;
|
||||
import versions.version2.a3d.materials.A3D2Image;
|
||||
import versions.version2.a3d.materials.A3D2Map;
|
||||
import versions.version2.a3d.materials.A3D2Material;
|
||||
import versions.version2.a3d.objects.A3D2AmbientLight;
|
||||
import versions.version2.a3d.objects.A3D2Box;
|
||||
import versions.version2.a3d.objects.A3D2Decal;
|
||||
import versions.version2.a3d.objects.A3D2DirectionalLight;
|
||||
import versions.version2.a3d.objects.A3D2Joint;
|
||||
import versions.version2.a3d.objects.A3D2Mesh;
|
||||
import versions.version2.a3d.objects.A3D2Object;
|
||||
import versions.version2.a3d.objects.A3D2OmniLight;
|
||||
import versions.version2.a3d.objects.A3D2Skin;
|
||||
import versions.version2.a3d.objects.A3D2SpotLight;
|
||||
import versions.version2.a3d.objects.A3D2Sprite;
|
||||
|
||||
public class CodecA3D2 implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-8X§:ICodec;
|
||||
|
||||
private var §_-Fa§:ICodec;
|
||||
|
||||
private var §_-Aj§:ICodec;
|
||||
|
||||
private var §_-EA§:ICodec;
|
||||
|
||||
private var §_-lJ§:ICodec;
|
||||
|
||||
private var §_-9f§:ICodec;
|
||||
|
||||
private var §_-GC§:ICodec;
|
||||
|
||||
private var §_-Sd§:ICodec;
|
||||
|
||||
private var §_-76§:ICodec;
|
||||
|
||||
private var §_-3f§:ICodec;
|
||||
|
||||
private var §_-dB§:ICodec;
|
||||
|
||||
private var §_-77§:ICodec;
|
||||
|
||||
private var §_-PJ§:ICodec;
|
||||
|
||||
private var §_-1x§:ICodec;
|
||||
|
||||
private var §_-aP§:ICodec;
|
||||
|
||||
private var §_-e9§:ICodec;
|
||||
|
||||
private var §_-3y§:ICodec;
|
||||
|
||||
private var §_-E2§:ICodec;
|
||||
|
||||
private var §_-U9§:ICodec;
|
||||
|
||||
public function CodecA3D2()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-8X§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2AmbientLight,false),true,1));
|
||||
this.§_-Fa§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2AnimationClip,false),true,1));
|
||||
this.§_-Aj§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Track,false),true,1));
|
||||
this.§_-EA§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Box,false),true,1));
|
||||
this.§_-lJ§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2CubeMap,false),true,1));
|
||||
this.§_-9f§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Decal,false),true,1));
|
||||
this.§_-GC§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2DirectionalLight,false),true,1));
|
||||
this.§_-Sd§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Image,false),true,1));
|
||||
this.§_-76§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2IndexBuffer,false),true,1));
|
||||
this.§_-3f§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Joint,false),true,1));
|
||||
this.§_-dB§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Map,false),true,1));
|
||||
this.§_-77§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Material,false),true,1));
|
||||
this.§_-PJ§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Mesh,false),true,1));
|
||||
this.§_-1x§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Object,false),true,1));
|
||||
this.§_-aP§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2OmniLight,false),true,1));
|
||||
this.§_-e9§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Skin,false),true,1));
|
||||
this.§_-3y§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2SpotLight,false),true,1));
|
||||
this.§_-E2§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Sprite,false),true,1));
|
||||
this.§_-U9§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2VertexBuffer,false),true,1));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_ambientLights:Vector.<A3D2AmbientLight> = this.§_-8X§.decode(protocolBuffer) as Vector.<A3D2AmbientLight>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","ambientLights",value_ambientLights);
|
||||
var value_animationClips:Vector.<A3D2AnimationClip> = this.§_-Fa§.decode(protocolBuffer) as Vector.<A3D2AnimationClip>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","animationClips",value_animationClips);
|
||||
var value_animationTracks:Vector.<A3D2Track> = this.§_-Aj§.decode(protocolBuffer) as Vector.<A3D2Track>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","animationTracks",value_animationTracks);
|
||||
var value_boxes:Vector.<A3D2Box> = this.§_-EA§.decode(protocolBuffer) as Vector.<A3D2Box>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","boxes",value_boxes);
|
||||
var value_cubeMaps:Vector.<A3D2CubeMap> = this.§_-lJ§.decode(protocolBuffer) as Vector.<A3D2CubeMap>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","cubeMaps",value_cubeMaps);
|
||||
var value_decals:Vector.<A3D2Decal> = this.§_-9f§.decode(protocolBuffer) as Vector.<A3D2Decal>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","decals",value_decals);
|
||||
var value_directionalLights:Vector.<A3D2DirectionalLight> = this.§_-GC§.decode(protocolBuffer) as Vector.<A3D2DirectionalLight>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","directionalLights",value_directionalLights);
|
||||
var value_images:Vector.<A3D2Image> = this.§_-Sd§.decode(protocolBuffer) as Vector.<A3D2Image>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","images",value_images);
|
||||
var value_indexBuffers:Vector.<A3D2IndexBuffer> = this.§_-76§.decode(protocolBuffer) as Vector.<A3D2IndexBuffer>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","indexBuffers",value_indexBuffers);
|
||||
var value_joints:Vector.<A3D2Joint> = this.§_-3f§.decode(protocolBuffer) as Vector.<A3D2Joint>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","joints",value_joints);
|
||||
var value_maps:Vector.<A3D2Map> = this.§_-dB§.decode(protocolBuffer) as Vector.<A3D2Map>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","maps",value_maps);
|
||||
var value_materials:Vector.<A3D2Material> = this.§_-77§.decode(protocolBuffer) as Vector.<A3D2Material>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","materials",value_materials);
|
||||
var value_meshes:Vector.<A3D2Mesh> = this.§_-PJ§.decode(protocolBuffer) as Vector.<A3D2Mesh>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","meshes",value_meshes);
|
||||
var value_objects:Vector.<A3D2Object> = this.§_-1x§.decode(protocolBuffer) as Vector.<A3D2Object>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","objects",value_objects);
|
||||
var value_omniLights:Vector.<A3D2OmniLight> = this.§_-aP§.decode(protocolBuffer) as Vector.<A3D2OmniLight>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","omniLights",value_omniLights);
|
||||
var value_skins:Vector.<A3D2Skin> = this.§_-e9§.decode(protocolBuffer) as Vector.<A3D2Skin>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","skins",value_skins);
|
||||
var value_spotLights:Vector.<A3D2SpotLight> = this.§_-3y§.decode(protocolBuffer) as Vector.<A3D2SpotLight>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","spotLights",value_spotLights);
|
||||
var value_sprites:Vector.<A3D2Sprite> = this.§_-E2§.decode(protocolBuffer) as Vector.<A3D2Sprite>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","sprites",value_sprites);
|
||||
var value_vertexBuffers:Vector.<A3D2VertexBuffer> = this.§_-U9§.decode(protocolBuffer) as Vector.<A3D2VertexBuffer>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.A3D2","vertexBuffers",value_vertexBuffers);
|
||||
return new A3D2(value_ambientLights,value_animationClips,value_animationTracks,value_boxes,value_cubeMaps,value_decals,value_directionalLights,value_images,value_indexBuffers,value_joints,value_maps,value_materials,value_meshes,value_objects,value_omniLights,value_skins,value_spotLights,value_sprites,value_vertexBuffers);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2 = A3D2(object);
|
||||
this.§_-8X§.encode(protocolBuffer,struct.ambientLights);
|
||||
this.§_-Fa§.encode(protocolBuffer,struct.animationClips);
|
||||
this.§_-Aj§.encode(protocolBuffer,struct.animationTracks);
|
||||
this.§_-EA§.encode(protocolBuffer,struct.boxes);
|
||||
this.§_-lJ§.encode(protocolBuffer,struct.cubeMaps);
|
||||
this.§_-9f§.encode(protocolBuffer,struct.decals);
|
||||
this.§_-GC§.encode(protocolBuffer,struct.directionalLights);
|
||||
this.§_-Sd§.encode(protocolBuffer,struct.images);
|
||||
this.§_-76§.encode(protocolBuffer,struct.indexBuffers);
|
||||
this.§_-3f§.encode(protocolBuffer,struct.joints);
|
||||
this.§_-dB§.encode(protocolBuffer,struct.maps);
|
||||
this.§_-77§.encode(protocolBuffer,struct.materials);
|
||||
this.§_-PJ§.encode(protocolBuffer,struct.meshes);
|
||||
this.§_-1x§.encode(protocolBuffer,struct.objects);
|
||||
this.§_-aP§.encode(protocolBuffer,struct.omniLights);
|
||||
this.§_-e9§.encode(protocolBuffer,struct.skins);
|
||||
this.§_-3y§.encode(protocolBuffer,struct.spotLights);
|
||||
this.§_-E2§.encode(protocolBuffer,struct.sprites);
|
||||
this.§_-U9§.encode(protocolBuffer,struct.vertexBuffers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
src/_codec/versions/version2/a3d/VectorCodecA3D2Level1.as
Normal file
59
src/_codec/versions/version2/a3d/VectorCodecA3D2Level1.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version2.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.version2.a3d.A3D2;
|
||||
|
||||
public class VectorCodecA3D2Level1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2Level1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2,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.<A3D2> = new Vector.<A3D2>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2(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.<A3D2> = Vector.<A3D2>(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/version2/a3d/VectorCodecA3D2Level2.as
Normal file
89
src/_codec/versions/version2/a3d/VectorCodecA3D2Level2.as
Normal file
@@ -0,0 +1,89 @@
|
||||
package _codec.versions.version2.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.version2.a3d.A3D2;
|
||||
|
||||
public class VectorCodecA3D2Level2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2Level2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2>> = new Vector.<Vector.<A3D2>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2> = 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.<A3D2>> = Vector.<Vector.<A3D2>>(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/version2/a3d/VectorCodecA3D2Level3.as
Normal file
119
src/_codec/versions/version2/a3d/VectorCodecA3D2Level3.as
Normal file
@@ -0,0 +1,119 @@
|
||||
package _codec.versions.version2.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.version2.a3d.A3D2;
|
||||
|
||||
public class VectorCodecA3D2Level3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2Level3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2>>> = new Vector.<Vector.<Vector.<A3D2>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2> = 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.<A3D2>>> = Vector.<Vector.<Vector.<A3D2>>>(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,72 @@
|
||||
package _codec.versions.version2.a3d.animation
|
||||
{
|
||||
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.Long;
|
||||
import versions.version2.a3d.animation.A3D2AnimationClip;
|
||||
|
||||
public class CodecA3D2AnimationClip implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-HX§:ICodec;
|
||||
|
||||
private var §_-XW§:ICodec;
|
||||
|
||||
private var §_-Td§:ICodec;
|
||||
|
||||
private var §_-Z-§:ICodec;
|
||||
|
||||
public function CodecA3D2AnimationClip()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-HX§ = protocol.getCodec(new TypeCodecInfo(Boolean,false));
|
||||
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
this.§_-Td§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Long,false),true,1));
|
||||
this.§_-Z-§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(int,false),false,1));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","id",value_id);
|
||||
var value_loop:Boolean = Boolean(this.§_-HX§.decode(protocolBuffer) as Boolean);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","loop",value_loop);
|
||||
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","name",value_name);
|
||||
var value_objectIDs:Vector.<Long> = this.§_-Td§.decode(protocolBuffer) as Vector.<Long>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","objectIDs",value_objectIDs);
|
||||
var value_tracks:Vector.<int> = this.§_-Z-§.decode(protocolBuffer) as Vector.<int>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2AnimationClip","tracks",value_tracks);
|
||||
return new A3D2AnimationClip(value_id,value_loop,value_name,value_objectIDs,value_tracks);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2AnimationClip = A3D2AnimationClip(object);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-HX§.encode(protocolBuffer,struct.loop);
|
||||
this.§_-XW§.encode(protocolBuffer,struct.name);
|
||||
this.§_-Td§.encode(protocolBuffer,struct.objectIDs);
|
||||
this.§_-Z-§.encode(protocolBuffer,struct.tracks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package _codec.versions.version2.a3d.animation
|
||||
{
|
||||
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 versions.version2.a3d.animation.A3D2Keyframe;
|
||||
import versions.version2.a3d.objects.A3D2Transform;
|
||||
|
||||
public class CodecA3D2Keyframe implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-dk§:ICodec;
|
||||
|
||||
private var §_-S2§:ICodec;
|
||||
|
||||
public function CodecA3D2Keyframe()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-dk§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-S2§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_time:Number = Number(this.§_-dk§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Keyframe","time",value_time);
|
||||
var value_transform:A3D2Transform = this.§_-S2§.decode(protocolBuffer) as A3D2Transform;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Keyframe","transform",value_transform);
|
||||
return new A3D2Keyframe(value_time,value_transform);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2Keyframe = A3D2Keyframe(object);
|
||||
this.§_-dk§.encode(protocolBuffer,struct.time);
|
||||
this.§_-S2§.encode(protocolBuffer,struct.transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
60
src/_codec/versions/version2/a3d/animation/CodecA3D2Track.as
Normal file
60
src/_codec/versions/version2/a3d/animation/CodecA3D2Track.as
Normal file
@@ -0,0 +1,60 @@
|
||||
package _codec.versions.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2Keyframe;
|
||||
import versions.version2.a3d.animation.A3D2Track;
|
||||
|
||||
public class CodecA3D2Track implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-Ja§:ICodec;
|
||||
|
||||
private var §_-Fo§:ICodec;
|
||||
|
||||
public function CodecA3D2Track()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-Ja§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Keyframe,false),false,1));
|
||||
this.§_-Fo§ = protocol.getCodec(new TypeCodecInfo(String,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Track","id",value_id);
|
||||
var value_keyframes:Vector.<A3D2Keyframe> = this.§_-Ja§.decode(protocolBuffer) as Vector.<A3D2Keyframe>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Track","keyframes",value_keyframes);
|
||||
var value_objectName:String = this.§_-Fo§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.animation.A3D2Track","objectName",value_objectName);
|
||||
return new A3D2Track(value_id,value_keyframes,value_objectName);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2Track = A3D2Track(object);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-Ja§.encode(protocolBuffer,struct.keyframes);
|
||||
this.§_-Fo§.encode(protocolBuffer,struct.objectName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2AnimationClip;
|
||||
|
||||
public class VectorCodecA3D2AnimationClipLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2AnimationClipLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2AnimationClip,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.<A3D2AnimationClip> = new Vector.<A3D2AnimationClip>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2AnimationClip(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.<A3D2AnimationClip> = Vector.<A3D2AnimationClip>(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.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2AnimationClip;
|
||||
|
||||
public class VectorCodecA3D2AnimationClipLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2AnimationClipLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2AnimationClip,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2AnimationClip> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2AnimationClip>> = new Vector.<Vector.<A3D2AnimationClip>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2AnimationClip>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2AnimationClip(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2AnimationClip> = 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.<A3D2AnimationClip>> = Vector.<Vector.<A3D2AnimationClip>>(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.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2AnimationClip;
|
||||
|
||||
public class VectorCodecA3D2AnimationClipLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2AnimationClipLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2AnimationClip,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2AnimationClip>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2AnimationClip> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2AnimationClip>>> = new Vector.<Vector.<Vector.<A3D2AnimationClip>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2AnimationClip>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2AnimationClip>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2AnimationClip(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2AnimationClip>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2AnimationClip> = 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.<A3D2AnimationClip>>> = Vector.<Vector.<Vector.<A3D2AnimationClip>>>(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.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2Keyframe;
|
||||
|
||||
public class VectorCodecA3D2KeyframeLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2KeyframeLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Keyframe,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.<A3D2Keyframe> = new Vector.<A3D2Keyframe>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2Keyframe(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.<A3D2Keyframe> = Vector.<A3D2Keyframe>(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.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2Keyframe;
|
||||
|
||||
public class VectorCodecA3D2KeyframeLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2KeyframeLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Keyframe,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2Keyframe> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2Keyframe>> = new Vector.<Vector.<A3D2Keyframe>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2Keyframe>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2Keyframe(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2Keyframe> = 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.<A3D2Keyframe>> = Vector.<Vector.<A3D2Keyframe>>(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.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2Keyframe;
|
||||
|
||||
public class VectorCodecA3D2KeyframeLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2KeyframeLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Keyframe,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2Keyframe>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2Keyframe> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2Keyframe>>> = new Vector.<Vector.<Vector.<A3D2Keyframe>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2Keyframe>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2Keyframe>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2Keyframe(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2Keyframe>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2Keyframe> = 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.<A3D2Keyframe>>> = Vector.<Vector.<Vector.<A3D2Keyframe>>>(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.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2Track;
|
||||
|
||||
public class VectorCodecA3D2TrackLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2TrackLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Track,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.<A3D2Track> = new Vector.<A3D2Track>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2Track(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.<A3D2Track> = Vector.<A3D2Track>(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.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2Track;
|
||||
|
||||
public class VectorCodecA3D2TrackLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2TrackLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Track,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2Track> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2Track>> = new Vector.<Vector.<A3D2Track>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2Track>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2Track(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2Track> = 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.<A3D2Track>> = Vector.<Vector.<A3D2Track>>(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.version2.a3d.animation
|
||||
{
|
||||
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.version2.a3d.animation.A3D2Track;
|
||||
|
||||
public class VectorCodecA3D2TrackLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2TrackLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Track,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2Track>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2Track> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2Track>>> = new Vector.<Vector.<Vector.<A3D2Track>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2Track>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2Track>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2Track(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2Track>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2Track> = 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.<A3D2Track>>> = Vector.<Vector.<Vector.<A3D2Track>>>(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.version2.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.version2.a3d.geometry.A3D2IndexBuffer;
|
||||
|
||||
public class CodecA3D2IndexBuffer implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-GN§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-mz§:ICodec;
|
||||
|
||||
public function CodecA3D2IndexBuffer()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-GN§ = protocol.getCodec(new TypeCodecInfo(ByteArray,false));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
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.version2.a3d.geometry.A3D2IndexBuffer","byteBuffer",value_byteBuffer);
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2IndexBuffer","id",value_id);
|
||||
var value_indexCount:int = int(this.§_-mz§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2IndexBuffer","indexCount",value_indexCount);
|
||||
return new A3D2IndexBuffer(value_byteBuffer,value_id,value_indexCount);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2IndexBuffer = A3D2IndexBuffer(object);
|
||||
this.§_-GN§.encode(protocolBuffer,struct.byteBuffer);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-mz§.encode(protocolBuffer,struct.indexCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package _codec.versions.version2.a3d.geometry
|
||||
{
|
||||
import alternativa.protocol.ICodec;
|
||||
import alternativa.protocol.IProtocol;
|
||||
import alternativa.protocol.ProtocolBuffer;
|
||||
import versions.version2.a3d.geometry.A3D2VertexAttributes;
|
||||
|
||||
public class CodecA3D2VertexAttributes implements ICodec
|
||||
{
|
||||
public function CodecA3D2VertexAttributes()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var result:A3D2VertexAttributes = null;
|
||||
var value:int = int(protocolBuffer.reader.readInt());
|
||||
switch(value)
|
||||
{
|
||||
case 0:
|
||||
result = A3D2VertexAttributes.POSITION;
|
||||
break;
|
||||
case 1:
|
||||
result = A3D2VertexAttributes.NORMAL;
|
||||
break;
|
||||
case 2:
|
||||
result = A3D2VertexAttributes.TANGENT4;
|
||||
break;
|
||||
case 3:
|
||||
result = A3D2VertexAttributes.JOINT;
|
||||
break;
|
||||
case 4:
|
||||
result = A3D2VertexAttributes.TEXCOORD;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var value:int = int(object.value);
|
||||
protocolBuffer.writer.writeInt(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package _codec.versions.version2.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.EnumCodecInfo;
|
||||
import alternativa.protocol.info.TypeCodecInfo;
|
||||
import alternativa.types.UShort;
|
||||
import flash.utils.ByteArray;
|
||||
import versions.version2.a3d.geometry.A3D2VertexAttributes;
|
||||
import versions.version2.a3d.geometry.A3D2VertexBuffer;
|
||||
|
||||
public class CodecA3D2VertexBuffer implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Lj§:ICodec;
|
||||
|
||||
private var §_-GN§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-hc§:ICodec;
|
||||
|
||||
public function CodecA3D2VertexBuffer()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Lj§ = protocol.getCodec(new CollectionCodecInfo(new EnumCodecInfo(A3D2VertexAttributes,false),false,1));
|
||||
this.§_-GN§ = protocol.getCodec(new TypeCodecInfo(ByteArray,false));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-hc§ = protocol.getCodec(new TypeCodecInfo(UShort,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_attributes:Vector.<A3D2VertexAttributes> = this.§_-Lj§.decode(protocolBuffer) as Vector.<A3D2VertexAttributes>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2VertexBuffer","attributes",value_attributes);
|
||||
var value_byteBuffer:ByteArray = this.§_-GN§.decode(protocolBuffer) as ByteArray;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2VertexBuffer","byteBuffer",value_byteBuffer);
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2VertexBuffer","id",value_id);
|
||||
var value_vertexCount:uint = uint(this.§_-hc§.decode(protocolBuffer) as uint);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.geometry.A3D2VertexBuffer","vertexCount",value_vertexCount);
|
||||
return new A3D2VertexBuffer(value_attributes,value_byteBuffer,value_id,value_vertexCount);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2VertexBuffer = A3D2VertexBuffer(object);
|
||||
this.§_-Lj§.encode(protocolBuffer,struct.attributes);
|
||||
this.§_-GN§.encode(protocolBuffer,struct.byteBuffer);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-hc§.encode(protocolBuffer,struct.vertexCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version2.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.version2.a3d.geometry.A3D2IndexBuffer;
|
||||
|
||||
public class VectorCodecA3D2IndexBufferLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2IndexBufferLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2IndexBuffer,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.<A3D2IndexBuffer> = new Vector.<A3D2IndexBuffer>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2IndexBuffer(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.<A3D2IndexBuffer> = Vector.<A3D2IndexBuffer>(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.version2.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.version2.a3d.geometry.A3D2IndexBuffer;
|
||||
|
||||
public class VectorCodecA3D2IndexBufferLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2IndexBufferLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2IndexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2IndexBuffer> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2IndexBuffer>> = new Vector.<Vector.<A3D2IndexBuffer>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2IndexBuffer>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2IndexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2IndexBuffer> = 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.<A3D2IndexBuffer>> = Vector.<Vector.<A3D2IndexBuffer>>(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.version2.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.version2.a3d.geometry.A3D2IndexBuffer;
|
||||
|
||||
public class VectorCodecA3D2IndexBufferLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2IndexBufferLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2IndexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2IndexBuffer>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2IndexBuffer> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2IndexBuffer>>> = new Vector.<Vector.<Vector.<A3D2IndexBuffer>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2IndexBuffer>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2IndexBuffer>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2IndexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2IndexBuffer>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2IndexBuffer> = 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.<A3D2IndexBuffer>>> = Vector.<Vector.<Vector.<A3D2IndexBuffer>>>(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.version2.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.EnumCodecInfo;
|
||||
import versions.version2.a3d.geometry.A3D2VertexAttributes;
|
||||
|
||||
public class VectorCodecA3D2VertexAttributesLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2VertexAttributesLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new EnumCodecInfo(A3D2VertexAttributes,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.<A3D2VertexAttributes> = new Vector.<A3D2VertexAttributes>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2VertexAttributes(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.<A3D2VertexAttributes> = Vector.<A3D2VertexAttributes>(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.version2.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.EnumCodecInfo;
|
||||
import versions.version2.a3d.geometry.A3D2VertexAttributes;
|
||||
|
||||
public class VectorCodecA3D2VertexAttributesLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2VertexAttributesLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new EnumCodecInfo(A3D2VertexAttributes,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2VertexAttributes> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2VertexAttributes>> = new Vector.<Vector.<A3D2VertexAttributes>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2VertexAttributes>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2VertexAttributes(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2VertexAttributes> = 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.<A3D2VertexAttributes>> = Vector.<Vector.<A3D2VertexAttributes>>(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.version2.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.EnumCodecInfo;
|
||||
import versions.version2.a3d.geometry.A3D2VertexAttributes;
|
||||
|
||||
public class VectorCodecA3D2VertexAttributesLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2VertexAttributesLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new EnumCodecInfo(A3D2VertexAttributes,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2VertexAttributes>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2VertexAttributes> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2VertexAttributes>>> = new Vector.<Vector.<Vector.<A3D2VertexAttributes>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2VertexAttributes>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2VertexAttributes>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2VertexAttributes(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2VertexAttributes>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2VertexAttributes> = 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.<A3D2VertexAttributes>>> = Vector.<Vector.<Vector.<A3D2VertexAttributes>>>(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.version2.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.version2.a3d.geometry.A3D2VertexBuffer;
|
||||
|
||||
public class VectorCodecA3D2VertexBufferLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2VertexBufferLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2VertexBuffer,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.<A3D2VertexBuffer> = new Vector.<A3D2VertexBuffer>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2VertexBuffer(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.<A3D2VertexBuffer> = Vector.<A3D2VertexBuffer>(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.version2.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.version2.a3d.geometry.A3D2VertexBuffer;
|
||||
|
||||
public class VectorCodecA3D2VertexBufferLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2VertexBufferLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2VertexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2VertexBuffer> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2VertexBuffer>> = new Vector.<Vector.<A3D2VertexBuffer>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2VertexBuffer>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2VertexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2VertexBuffer> = 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.<A3D2VertexBuffer>> = Vector.<Vector.<A3D2VertexBuffer>>(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.version2.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.version2.a3d.geometry.A3D2VertexBuffer;
|
||||
|
||||
public class VectorCodecA3D2VertexBufferLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2VertexBufferLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2VertexBuffer,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2VertexBuffer>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2VertexBuffer> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2VertexBuffer>>> = new Vector.<Vector.<Vector.<A3D2VertexBuffer>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2VertexBuffer>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2VertexBuffer>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2VertexBuffer(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2VertexBuffer>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2VertexBuffer> = 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.<A3D2VertexBuffer>>> = Vector.<Vector.<Vector.<A3D2VertexBuffer>>>(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,82 @@
|
||||
package _codec.versions.version2.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 versions.version2.a3d.materials.A3D2CubeMap;
|
||||
|
||||
public class CodecA3D2CubeMap implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Yc§:ICodec;
|
||||
|
||||
private var §_-SV§:ICodec;
|
||||
|
||||
private var §_-Ni§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-nb§:ICodec;
|
||||
|
||||
private var §_-23§:ICodec;
|
||||
|
||||
private var §_-TW§:ICodec;
|
||||
|
||||
public function CodecA3D2CubeMap()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Yc§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-SV§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-Ni§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-nb§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-23§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-TW§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_backId:int = int(this.§_-Yc§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2CubeMap","backId",value_backId);
|
||||
var value_bottomId:int = int(this.§_-SV§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2CubeMap","bottomId",value_bottomId);
|
||||
var value_frontId:int = int(this.§_-Ni§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2CubeMap","frontId",value_frontId);
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2CubeMap","id",value_id);
|
||||
var value_leftId:int = int(this.§_-nb§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2CubeMap","leftId",value_leftId);
|
||||
var value_rightId:int = int(this.§_-23§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2CubeMap","rightId",value_rightId);
|
||||
var value_topId:int = int(this.§_-TW§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2CubeMap","topId",value_topId);
|
||||
return new A3D2CubeMap(value_backId,value_bottomId,value_frontId,value_id,value_leftId,value_rightId,value_topId);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2CubeMap = A3D2CubeMap(object);
|
||||
this.§_-Yc§.encode(protocolBuffer,struct.backId);
|
||||
this.§_-SV§.encode(protocolBuffer,struct.bottomId);
|
||||
this.§_-Ni§.encode(protocolBuffer,struct.frontId);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-nb§.encode(protocolBuffer,struct.leftId);
|
||||
this.§_-23§.encode(protocolBuffer,struct.rightId);
|
||||
this.§_-TW§.encode(protocolBuffer,struct.topId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
52
src/_codec/versions/version2/a3d/materials/CodecA3D2Image.as
Normal file
52
src/_codec/versions/version2/a3d/materials/CodecA3D2Image.as
Normal file
@@ -0,0 +1,52 @@
|
||||
package _codec.versions.version2.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 versions.version2.a3d.materials.A3D2Image;
|
||||
|
||||
public class CodecA3D2Image implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-aV§:ICodec;
|
||||
|
||||
public function CodecA3D2Image()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-aV§ = protocol.getCodec(new TypeCodecInfo(String,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Image","id",value_id);
|
||||
var value_url:String = this.§_-aV§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Image","url",value_url);
|
||||
return new A3D2Image(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:A3D2Image = A3D2Image(object);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-aV§.encode(protocolBuffer,struct.url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
59
src/_codec/versions/version2/a3d/materials/CodecA3D2Map.as
Normal file
59
src/_codec/versions/version2/a3d/materials/CodecA3D2Map.as
Normal file
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version2.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.UShort;
|
||||
import versions.version2.a3d.materials.A3D2Map;
|
||||
|
||||
public class CodecA3D2Map implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-mC§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-2N§:ICodec;
|
||||
|
||||
public function CodecA3D2Map()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-mC§ = protocol.getCodec(new TypeCodecInfo(UShort,false));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-2N§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
}
|
||||
|
||||
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.version2.a3d.materials.A3D2Map","channel",value_channel);
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Map","id",value_id);
|
||||
var value_imageId:int = int(this.§_-2N§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Map","imageId",value_imageId);
|
||||
return new A3D2Map(value_channel,value_id,value_imageId);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2Map = A3D2Map(object);
|
||||
this.§_-mC§.encode(protocolBuffer,struct.channel);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-2N§.encode(protocolBuffer,struct.imageId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package _codec.versions.version2.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 versions.version2.a3d.materials.A3D2Material;
|
||||
|
||||
public class CodecA3D2Material 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 §_-bz§:ICodec;
|
||||
|
||||
private var §_-FU§:ICodec;
|
||||
|
||||
public function CodecA3D2Material()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-9A§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-hw§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-Hu§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-GK§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-LZ§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-bz§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-FU§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_diffuseMapId:int = int(this.§_-9A§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Material","diffuseMapId",value_diffuseMapId);
|
||||
var value_glossinessMapId:int = int(this.§_-hw§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Material","glossinessMapId",value_glossinessMapId);
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Material","id",value_id);
|
||||
var value_lightMapId:int = int(this.§_-Hu§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Material","lightMapId",value_lightMapId);
|
||||
var value_normalMapId:int = int(this.§_-GK§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Material","normalMapId",value_normalMapId);
|
||||
var value_opacityMapId:int = int(this.§_-LZ§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Material","opacityMapId",value_opacityMapId);
|
||||
var value_reflectionCubeMapId:int = int(this.§_-bz§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Material","reflectionCubeMapId",value_reflectionCubeMapId);
|
||||
var value_specularMapId:int = int(this.§_-FU§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.materials.A3D2Material","specularMapId",value_specularMapId);
|
||||
return new A3D2Material(value_diffuseMapId,value_glossinessMapId,value_id,value_lightMapId,value_normalMapId,value_opacityMapId,value_reflectionCubeMapId,value_specularMapId);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2Material = A3D2Material(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.§_-bz§.encode(protocolBuffer,struct.reflectionCubeMapId);
|
||||
this.§_-FU§.encode(protocolBuffer,struct.specularMapId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package _codec.versions.version2.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.version2.a3d.materials.A3D2CubeMap;
|
||||
|
||||
public class VectorCodecA3D2CubeMapLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2CubeMapLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2CubeMap,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.<A3D2CubeMap> = new Vector.<A3D2CubeMap>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2CubeMap(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.<A3D2CubeMap> = Vector.<A3D2CubeMap>(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.version2.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.version2.a3d.materials.A3D2CubeMap;
|
||||
|
||||
public class VectorCodecA3D2CubeMapLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2CubeMapLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2CubeMap,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2CubeMap> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2CubeMap>> = new Vector.<Vector.<A3D2CubeMap>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2CubeMap>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2CubeMap(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2CubeMap> = 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.<A3D2CubeMap>> = Vector.<Vector.<A3D2CubeMap>>(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.version2.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.version2.a3d.materials.A3D2CubeMap;
|
||||
|
||||
public class VectorCodecA3D2CubeMapLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2CubeMapLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2CubeMap,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2CubeMap>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2CubeMap> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2CubeMap>>> = new Vector.<Vector.<Vector.<A3D2CubeMap>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2CubeMap>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2CubeMap>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2CubeMap(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2CubeMap>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2CubeMap> = 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.<A3D2CubeMap>>> = Vector.<Vector.<Vector.<A3D2CubeMap>>>(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.version2.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.version2.a3d.materials.A3D2Image;
|
||||
|
||||
public class VectorCodecA3D2ImageLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2ImageLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Image,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.<A3D2Image> = new Vector.<A3D2Image>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2Image(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.<A3D2Image> = Vector.<A3D2Image>(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.version2.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.version2.a3d.materials.A3D2Image;
|
||||
|
||||
public class VectorCodecA3D2ImageLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2ImageLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Image,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2Image> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2Image>> = new Vector.<Vector.<A3D2Image>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2Image>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2Image(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2Image> = 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.<A3D2Image>> = Vector.<Vector.<A3D2Image>>(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.version2.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.version2.a3d.materials.A3D2Image;
|
||||
|
||||
public class VectorCodecA3D2ImageLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2ImageLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Image,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2Image>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2Image> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2Image>>> = new Vector.<Vector.<Vector.<A3D2Image>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2Image>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2Image>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2Image(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2Image>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2Image> = 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.<A3D2Image>>> = Vector.<Vector.<Vector.<A3D2Image>>>(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.version2.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.version2.a3d.materials.A3D2Map;
|
||||
|
||||
public class VectorCodecA3D2MapLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2MapLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Map,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.<A3D2Map> = new Vector.<A3D2Map>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2Map(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.<A3D2Map> = Vector.<A3D2Map>(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.version2.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.version2.a3d.materials.A3D2Map;
|
||||
|
||||
public class VectorCodecA3D2MapLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2MapLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Map,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2Map> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2Map>> = new Vector.<Vector.<A3D2Map>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2Map>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2Map(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2Map> = 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.<A3D2Map>> = Vector.<Vector.<A3D2Map>>(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.version2.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.version2.a3d.materials.A3D2Map;
|
||||
|
||||
public class VectorCodecA3D2MapLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2MapLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Map,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2Map>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2Map> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2Map>>> = new Vector.<Vector.<Vector.<A3D2Map>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2Map>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2Map>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2Map(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2Map>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2Map> = 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.<A3D2Map>>> = Vector.<Vector.<Vector.<A3D2Map>>>(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.version2.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.version2.a3d.materials.A3D2Material;
|
||||
|
||||
public class VectorCodecA3D2MaterialLevel1 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2MaterialLevel1(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Material,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.<A3D2Material> = new Vector.<A3D2Material>(length,true);
|
||||
for(var i:int = 0; i < length; i++)
|
||||
{
|
||||
result[i] = A3D2Material(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.<A3D2Material> = Vector.<A3D2Material>(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.version2.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.version2.a3d.materials.A3D2Material;
|
||||
|
||||
public class VectorCodecA3D2MaterialLevel2 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2MaterialLevel2(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Material,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<A3D2Material> = null;
|
||||
var i2:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<A3D2Material>> = new Vector.<Vector.<A3D2Material>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<A3D2Material>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; i2++)
|
||||
{
|
||||
items2[i2] = A3D2Material(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<A3D2Material> = 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.<A3D2Material>> = Vector.<Vector.<A3D2Material>>(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.version2.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.version2.a3d.materials.A3D2Material;
|
||||
|
||||
public class VectorCodecA3D2MaterialLevel3 implements ICodec
|
||||
{
|
||||
private var elementCodec:ICodec;
|
||||
|
||||
private var optionalElement:Boolean;
|
||||
|
||||
public function VectorCodecA3D2MaterialLevel3(optionalElement:Boolean)
|
||||
{
|
||||
super();
|
||||
this.optionalElement = optionalElement;
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.elementCodec = protocol.getCodec(new TypeCodecInfo(A3D2Material,false));
|
||||
if(this.optionalElement)
|
||||
{
|
||||
this.elementCodec = new OptionalCodecDecorator(this.elementCodec);
|
||||
}
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
var length2:int = 0;
|
||||
var items2:Vector.<Vector.<A3D2Material>> = null;
|
||||
var i2:int = 0;
|
||||
var length3:int = 0;
|
||||
var items3:Vector.<A3D2Material> = null;
|
||||
var i3:int = 0;
|
||||
var length1:int = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
var result:Vector.<Vector.<Vector.<A3D2Material>>> = new Vector.<Vector.<Vector.<A3D2Material>>>(length1,true);
|
||||
for(var i1:int = 0; i1 < length1; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length2 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items2 = new Vector.<Vector.<A3D2Material>>(length2,true);
|
||||
result[i1] = items2;
|
||||
for(i2 = 0; i2 < length2; )
|
||||
{
|
||||
if(!protocolBuffer.optionalMap.OptionalMap())
|
||||
{
|
||||
length3 = LengthCodecHelper.decodeLength(protocolBuffer);
|
||||
items3 = new Vector.<A3D2Material>(length3,true);
|
||||
items2[i2] = items3;
|
||||
for(i3 = 0; i3 < length3; i3++)
|
||||
{
|
||||
items3[i3] = A3D2Material(this.elementCodec.decode(protocolBuffer));
|
||||
}
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
i1++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
var items2:Vector.<Vector.<A3D2Material>> = null;
|
||||
var length2:int = 0;
|
||||
var i2:int = 0;
|
||||
var items3:Vector.<A3D2Material> = 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.<A3D2Material>>> = Vector.<Vector.<Vector.<A3D2Material>>>(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,91 @@
|
||||
package _codec.versions.version2.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 alternativa.types.Float;
|
||||
import alternativa.types.Long;
|
||||
import versions.version2.a3d.objects.A3D2AmbientLight;
|
||||
import versions.version2.a3d.objects.A3D2Transform;
|
||||
|
||||
public class CodecA3D2AmbientLight implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Dh§:ICodec;
|
||||
|
||||
private var §_-Po§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-JX§:ICodec;
|
||||
|
||||
private var §_-XW§:ICodec;
|
||||
|
||||
private var §_-jk§:ICodec;
|
||||
|
||||
private var §_-S2§:ICodec;
|
||||
|
||||
private var §_-h9§:ICodec;
|
||||
|
||||
public function CodecA3D2AmbientLight()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Dh§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-Po§ = protocol.getCodec(new TypeCodecInfo(uint,false));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
this.§_-JX§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
this.§_-jk§ = protocol.getCodec(new TypeCodecInfo(Long,true));
|
||||
this.§_-S2§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,true));
|
||||
this.§_-h9§ = protocol.getCodec(new TypeCodecInfo(Boolean,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_boundBoxId:int = int(this.§_-Dh§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2AmbientLight","boundBoxId",value_boundBoxId);
|
||||
var value_color:uint = uint(this.§_-Po§.decode(protocolBuffer) as uint);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2AmbientLight","color",value_color);
|
||||
var value_id:Long = this.§_-2o§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2AmbientLight","id",value_id);
|
||||
var value_intensity:Number = Number(this.§_-JX§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2AmbientLight","intensity",value_intensity);
|
||||
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2AmbientLight","name",value_name);
|
||||
var value_parentId:Long = this.§_-jk§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2AmbientLight","parentId",value_parentId);
|
||||
var value_transform:A3D2Transform = this.§_-S2§.decode(protocolBuffer) as A3D2Transform;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2AmbientLight","transform",value_transform);
|
||||
var value_visible:Boolean = Boolean(this.§_-h9§.decode(protocolBuffer) as Boolean);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2AmbientLight","visible",value_visible);
|
||||
return new A3D2AmbientLight(value_boundBoxId,value_color,value_id,value_intensity,value_name,value_parentId,value_transform,value_visible);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2AmbientLight = A3D2AmbientLight(object);
|
||||
this.§_-Dh§.encode(protocolBuffer,struct.boundBoxId);
|
||||
this.§_-Po§.encode(protocolBuffer,struct.color);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-JX§.encode(protocolBuffer,struct.intensity);
|
||||
this.§_-XW§.encode(protocolBuffer,struct.name);
|
||||
this.§_-jk§.encode(protocolBuffer,struct.parentId);
|
||||
this.§_-S2§.encode(protocolBuffer,struct.transform);
|
||||
this.§_-h9§.encode(protocolBuffer,struct.visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
54
src/_codec/versions/version2/a3d/objects/CodecA3D2Box.as
Normal file
54
src/_codec/versions/version2/a3d/objects/CodecA3D2Box.as
Normal file
@@ -0,0 +1,54 @@
|
||||
package _codec.versions.version2.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 versions.version2.a3d.objects.A3D2Box;
|
||||
|
||||
public class CodecA3D2Box implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-pM§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
public function CodecA3D2Box()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-pM§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(Float,false),false,1));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
}
|
||||
|
||||
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.version2.a3d.objects.A3D2Box","box",value_box);
|
||||
var value_id:int = int(this.§_-2o§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Box","id",value_id);
|
||||
return new A3D2Box(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:A3D2Box = A3D2Box(object);
|
||||
this.§_-pM§.encode(protocolBuffer,struct.box);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
105
src/_codec/versions/version2/a3d/objects/CodecA3D2Decal.as
Normal file
105
src/_codec/versions/version2/a3d/objects/CodecA3D2Decal.as
Normal file
@@ -0,0 +1,105 @@
|
||||
package _codec.versions.version2.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 alternativa.types.Long;
|
||||
import versions.version2.a3d.objects.A3D2Decal;
|
||||
import versions.version2.a3d.objects.A3D2Surface;
|
||||
import versions.version2.a3d.objects.A3D2Transform;
|
||||
|
||||
public class CodecA3D2Decal implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Dh§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-PO§:ICodec;
|
||||
|
||||
private var §_-XW§:ICodec;
|
||||
|
||||
private var §_-Zb§:ICodec;
|
||||
|
||||
private var §_-jk§:ICodec;
|
||||
|
||||
private var §_-Qr§:ICodec;
|
||||
|
||||
private var §_-S2§:ICodec;
|
||||
|
||||
private var §_-U9§:ICodec;
|
||||
|
||||
private var §_-h9§:ICodec;
|
||||
|
||||
public function CodecA3D2Decal()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Dh§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
this.§_-PO§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
this.§_-Zb§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-jk§ = protocol.getCodec(new TypeCodecInfo(Long,true));
|
||||
this.§_-Qr§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Surface,false),false,1));
|
||||
this.§_-S2§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,true));
|
||||
this.§_-U9§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(int,false),false,1));
|
||||
this.§_-h9§ = protocol.getCodec(new TypeCodecInfo(Boolean,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_boundBoxId:int = int(this.§_-Dh§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","boundBoxId",value_boundBoxId);
|
||||
var value_id:Long = this.§_-2o§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","id",value_id);
|
||||
var value_indexBufferId:int = int(this.§_-PO§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","indexBufferId",value_indexBufferId);
|
||||
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","name",value_name);
|
||||
var value_offset:Number = Number(this.§_-Zb§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","offset",value_offset);
|
||||
var value_parentId:Long = this.§_-jk§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","parentId",value_parentId);
|
||||
var value_surfaces:Vector.<A3D2Surface> = this.§_-Qr§.decode(protocolBuffer) as Vector.<A3D2Surface>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","surfaces",value_surfaces);
|
||||
var value_transform:A3D2Transform = this.§_-S2§.decode(protocolBuffer) as A3D2Transform;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","transform",value_transform);
|
||||
var value_vertexBuffers:Vector.<int> = this.§_-U9§.decode(protocolBuffer) as Vector.<int>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","vertexBuffers",value_vertexBuffers);
|
||||
var value_visible:Boolean = Boolean(this.§_-h9§.decode(protocolBuffer) as Boolean);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Decal","visible",value_visible);
|
||||
return new A3D2Decal(value_boundBoxId,value_id,value_indexBufferId,value_name,value_offset,value_parentId,value_surfaces,value_transform,value_vertexBuffers,value_visible);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2Decal = A3D2Decal(object);
|
||||
this.§_-Dh§.encode(protocolBuffer,struct.boundBoxId);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-PO§.encode(protocolBuffer,struct.indexBufferId);
|
||||
this.§_-XW§.encode(protocolBuffer,struct.name);
|
||||
this.§_-Zb§.encode(protocolBuffer,struct.offset);
|
||||
this.§_-jk§.encode(protocolBuffer,struct.parentId);
|
||||
this.§_-Qr§.encode(protocolBuffer,struct.surfaces);
|
||||
this.§_-S2§.encode(protocolBuffer,struct.transform);
|
||||
this.§_-U9§.encode(protocolBuffer,struct.vertexBuffers);
|
||||
this.§_-h9§.encode(protocolBuffer,struct.visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package _codec.versions.version2.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 alternativa.types.Float;
|
||||
import alternativa.types.Long;
|
||||
import versions.version2.a3d.objects.A3D2DirectionalLight;
|
||||
import versions.version2.a3d.objects.A3D2Transform;
|
||||
|
||||
public class CodecA3D2DirectionalLight implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Dh§:ICodec;
|
||||
|
||||
private var §_-Po§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-JX§:ICodec;
|
||||
|
||||
private var §_-XW§:ICodec;
|
||||
|
||||
private var §_-jk§:ICodec;
|
||||
|
||||
private var §_-S2§:ICodec;
|
||||
|
||||
private var §_-h9§:ICodec;
|
||||
|
||||
public function CodecA3D2DirectionalLight()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Dh§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-Po§ = protocol.getCodec(new TypeCodecInfo(uint,false));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
this.§_-JX§ = protocol.getCodec(new TypeCodecInfo(Float,false));
|
||||
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
this.§_-jk§ = protocol.getCodec(new TypeCodecInfo(Long,true));
|
||||
this.§_-S2§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,true));
|
||||
this.§_-h9§ = protocol.getCodec(new TypeCodecInfo(Boolean,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_boundBoxId:int = int(this.§_-Dh§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2DirectionalLight","boundBoxId",value_boundBoxId);
|
||||
var value_color:uint = uint(this.§_-Po§.decode(protocolBuffer) as uint);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2DirectionalLight","color",value_color);
|
||||
var value_id:Long = this.§_-2o§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2DirectionalLight","id",value_id);
|
||||
var value_intensity:Number = Number(this.§_-JX§.decode(protocolBuffer) as Number);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2DirectionalLight","intensity",value_intensity);
|
||||
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2DirectionalLight","name",value_name);
|
||||
var value_parentId:Long = this.§_-jk§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2DirectionalLight","parentId",value_parentId);
|
||||
var value_transform:A3D2Transform = this.§_-S2§.decode(protocolBuffer) as A3D2Transform;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2DirectionalLight","transform",value_transform);
|
||||
var value_visible:Boolean = Boolean(this.§_-h9§.decode(protocolBuffer) as Boolean);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2DirectionalLight","visible",value_visible);
|
||||
return new A3D2DirectionalLight(value_boundBoxId,value_color,value_id,value_intensity,value_name,value_parentId,value_transform,value_visible);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2DirectionalLight = A3D2DirectionalLight(object);
|
||||
this.§_-Dh§.encode(protocolBuffer,struct.boundBoxId);
|
||||
this.§_-Po§.encode(protocolBuffer,struct.color);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-JX§.encode(protocolBuffer,struct.intensity);
|
||||
this.§_-XW§.encode(protocolBuffer,struct.name);
|
||||
this.§_-jk§.encode(protocolBuffer,struct.parentId);
|
||||
this.§_-S2§.encode(protocolBuffer,struct.transform);
|
||||
this.§_-h9§.encode(protocolBuffer,struct.visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
78
src/_codec/versions/version2/a3d/objects/CodecA3D2Joint.as
Normal file
78
src/_codec/versions/version2/a3d/objects/CodecA3D2Joint.as
Normal file
@@ -0,0 +1,78 @@
|
||||
package _codec.versions.version2.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 alternativa.types.Long;
|
||||
import versions.version2.a3d.objects.A3D2Joint;
|
||||
import versions.version2.a3d.objects.A3D2Transform;
|
||||
|
||||
public class CodecA3D2Joint implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Dh§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-XW§:ICodec;
|
||||
|
||||
private var §_-jk§:ICodec;
|
||||
|
||||
private var §_-S2§:ICodec;
|
||||
|
||||
private var §_-h9§:ICodec;
|
||||
|
||||
public function CodecA3D2Joint()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Dh§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
this.§_-jk§ = protocol.getCodec(new TypeCodecInfo(Long,true));
|
||||
this.§_-S2§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,true));
|
||||
this.§_-h9§ = protocol.getCodec(new TypeCodecInfo(Boolean,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_boundBoxId:int = int(this.§_-Dh§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Joint","boundBoxId",value_boundBoxId);
|
||||
var value_id:Long = this.§_-2o§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Joint","id",value_id);
|
||||
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Joint","name",value_name);
|
||||
var value_parentId:Long = this.§_-jk§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Joint","parentId",value_parentId);
|
||||
var value_transform:A3D2Transform = this.§_-S2§.decode(protocolBuffer) as A3D2Transform;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Joint","transform",value_transform);
|
||||
var value_visible:Boolean = Boolean(this.§_-h9§.decode(protocolBuffer) as Boolean);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Joint","visible",value_visible);
|
||||
return new A3D2Joint(value_boundBoxId,value_id,value_name,value_parentId,value_transform,value_visible);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2Joint = A3D2Joint(object);
|
||||
this.§_-Dh§.encode(protocolBuffer,struct.boundBoxId);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-XW§.encode(protocolBuffer,struct.name);
|
||||
this.§_-jk§.encode(protocolBuffer,struct.parentId);
|
||||
this.§_-S2§.encode(protocolBuffer,struct.transform);
|
||||
this.§_-h9§.encode(protocolBuffer,struct.visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package _codec.versions.version2.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 alternativa.types.Long;
|
||||
import versions.version2.a3d.objects.A3D2JointBindTransform;
|
||||
import versions.version2.a3d.objects.A3D2Transform;
|
||||
|
||||
public class CodecA3D2JointBindTransform implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Ov§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
public function CodecA3D2JointBindTransform()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Ov§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,false));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_bindPoseTransform:A3D2Transform = this.§_-Ov§.decode(protocolBuffer) as A3D2Transform;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2JointBindTransform","bindPoseTransform",value_bindPoseTransform);
|
||||
var value_id:Long = this.§_-2o§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2JointBindTransform","id",value_id);
|
||||
return new A3D2JointBindTransform(value_bindPoseTransform,value_id);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2JointBindTransform = A3D2JointBindTransform(object);
|
||||
this.§_-Ov§.encode(protocolBuffer,struct.bindPoseTransform);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
98
src/_codec/versions/version2/a3d/objects/CodecA3D2Mesh.as
Normal file
98
src/_codec/versions/version2/a3d/objects/CodecA3D2Mesh.as
Normal file
@@ -0,0 +1,98 @@
|
||||
package _codec.versions.version2.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.Long;
|
||||
import versions.version2.a3d.objects.A3D2Mesh;
|
||||
import versions.version2.a3d.objects.A3D2Surface;
|
||||
import versions.version2.a3d.objects.A3D2Transform;
|
||||
|
||||
public class CodecA3D2Mesh implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Dh§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-PO§:ICodec;
|
||||
|
||||
private var §_-XW§:ICodec;
|
||||
|
||||
private var §_-jk§:ICodec;
|
||||
|
||||
private var §_-Qr§:ICodec;
|
||||
|
||||
private var §_-S2§:ICodec;
|
||||
|
||||
private var §_-U9§:ICodec;
|
||||
|
||||
private var §_-h9§:ICodec;
|
||||
|
||||
public function CodecA3D2Mesh()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Dh§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
this.§_-PO§ = protocol.getCodec(new TypeCodecInfo(int,false));
|
||||
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
this.§_-jk§ = protocol.getCodec(new TypeCodecInfo(Long,true));
|
||||
this.§_-Qr§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(A3D2Surface,false),false,1));
|
||||
this.§_-S2§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,true));
|
||||
this.§_-U9§ = protocol.getCodec(new CollectionCodecInfo(new TypeCodecInfo(int,false),false,1));
|
||||
this.§_-h9§ = protocol.getCodec(new TypeCodecInfo(Boolean,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_boundBoxId:int = int(this.§_-Dh§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","boundBoxId",value_boundBoxId);
|
||||
var value_id:Long = this.§_-2o§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","id",value_id);
|
||||
var value_indexBufferId:int = int(this.§_-PO§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","indexBufferId",value_indexBufferId);
|
||||
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","name",value_name);
|
||||
var value_parentId:Long = this.§_-jk§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","parentId",value_parentId);
|
||||
var value_surfaces:Vector.<A3D2Surface> = this.§_-Qr§.decode(protocolBuffer) as Vector.<A3D2Surface>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","surfaces",value_surfaces);
|
||||
var value_transform:A3D2Transform = this.§_-S2§.decode(protocolBuffer) as A3D2Transform;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","transform",value_transform);
|
||||
var value_vertexBuffers:Vector.<int> = this.§_-U9§.decode(protocolBuffer) as Vector.<int>;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","vertexBuffers",value_vertexBuffers);
|
||||
var value_visible:Boolean = Boolean(this.§_-h9§.decode(protocolBuffer) as Boolean);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Mesh","visible",value_visible);
|
||||
return new A3D2Mesh(value_boundBoxId,value_id,value_indexBufferId,value_name,value_parentId,value_surfaces,value_transform,value_vertexBuffers,value_visible);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2Mesh = A3D2Mesh(object);
|
||||
this.§_-Dh§.encode(protocolBuffer,struct.boundBoxId);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-PO§.encode(protocolBuffer,struct.indexBufferId);
|
||||
this.§_-XW§.encode(protocolBuffer,struct.name);
|
||||
this.§_-jk§.encode(protocolBuffer,struct.parentId);
|
||||
this.§_-Qr§.encode(protocolBuffer,struct.surfaces);
|
||||
this.§_-S2§.encode(protocolBuffer,struct.transform);
|
||||
this.§_-U9§.encode(protocolBuffer,struct.vertexBuffers);
|
||||
this.§_-h9§.encode(protocolBuffer,struct.visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
78
src/_codec/versions/version2/a3d/objects/CodecA3D2Object.as
Normal file
78
src/_codec/versions/version2/a3d/objects/CodecA3D2Object.as
Normal file
@@ -0,0 +1,78 @@
|
||||
package _codec.versions.version2.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 alternativa.types.Long;
|
||||
import versions.version2.a3d.objects.A3D2Object;
|
||||
import versions.version2.a3d.objects.A3D2Transform;
|
||||
|
||||
public class CodecA3D2Object implements ICodec
|
||||
{
|
||||
public static var log:IClientLog = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
|
||||
private var §_-Dh§:ICodec;
|
||||
|
||||
private var §_-2o§:ICodec;
|
||||
|
||||
private var §_-XW§:ICodec;
|
||||
|
||||
private var §_-jk§:ICodec;
|
||||
|
||||
private var §_-S2§:ICodec;
|
||||
|
||||
private var §_-h9§:ICodec;
|
||||
|
||||
public function CodecA3D2Object()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function init(protocol:IProtocol) : void
|
||||
{
|
||||
this.§_-Dh§ = protocol.getCodec(new TypeCodecInfo(int,true));
|
||||
this.§_-2o§ = protocol.getCodec(new TypeCodecInfo(Long,false));
|
||||
this.§_-XW§ = protocol.getCodec(new TypeCodecInfo(String,true));
|
||||
this.§_-jk§ = protocol.getCodec(new TypeCodecInfo(Long,true));
|
||||
this.§_-S2§ = protocol.getCodec(new TypeCodecInfo(A3D2Transform,true));
|
||||
this.§_-h9§ = protocol.getCodec(new TypeCodecInfo(Boolean,false));
|
||||
}
|
||||
|
||||
public function decode(protocolBuffer:ProtocolBuffer) : Object
|
||||
{
|
||||
log = IClientLog(OSGi.getInstance().getService(IClientLog));
|
||||
var value_boundBoxId:int = int(this.§_-Dh§.decode(protocolBuffer) as int);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Object","boundBoxId",value_boundBoxId);
|
||||
var value_id:Long = this.§_-2o§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Object","id",value_id);
|
||||
var value_name:String = this.§_-XW§.decode(protocolBuffer) as String;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Object","name",value_name);
|
||||
var value_parentId:Long = this.§_-jk§.decode(protocolBuffer) as Long;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Object","parentId",value_parentId);
|
||||
var value_transform:A3D2Transform = this.§_-S2§.decode(protocolBuffer) as A3D2Transform;
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Object","transform",value_transform);
|
||||
var value_visible:Boolean = Boolean(this.§_-h9§.decode(protocolBuffer) as Boolean);
|
||||
log.log("codec","struct %1 field %2 value %3","versions.version2.a3d.objects.A3D2Object","visible",value_visible);
|
||||
return new A3D2Object(value_boundBoxId,value_id,value_name,value_parentId,value_transform,value_visible);
|
||||
}
|
||||
|
||||
public function encode(protocolBuffer:ProtocolBuffer, object:Object) : void
|
||||
{
|
||||
if(object == null)
|
||||
{
|
||||
throw new Error("Object is null. Use @ProtocolOptional annotation.");
|
||||
}
|
||||
var struct:A3D2Object = A3D2Object(object);
|
||||
this.§_-Dh§.encode(protocolBuffer,struct.boundBoxId);
|
||||
this.§_-2o§.encode(protocolBuffer,struct.id);
|
||||
this.§_-XW§.encode(protocolBuffer,struct.name);
|
||||
this.§_-jk§.encode(protocolBuffer,struct.parentId);
|
||||
this.§_-S2§.encode(protocolBuffer,struct.transform);
|
||||
this.§_-h9§.encode(protocolBuffer,struct.visible);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user