///<summary> Writes this HLAupdateAttributeValuesBestEffortWithTimeMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { base.Serialize(writer, obj); //byte[] logicalTimeBytesArray = ((HLAupdateAttributeValuesBestEffortWithTimeMessage)obj).LogicalTime; //writer.WriteHLAopaqueData(logicalTimeBytesArray); }
///<summary> Writes this HLAsubscribeInteractionClassMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { base.Serialize(writer, obj); IInteractionClassHandle interactionClassHandle = (((HLAsubscribeInteractionClassMessage)obj).HLAinteractionClass); byte[] interactionClassHandleByteArray = new byte[interactionClassHandle.EncodedLength()]; interactionClassHandle.Encode(interactionClassHandleByteArray, 0); writer.WriteHLAopaqueData(interactionClassHandleByteArray); writer.WriteHLAboolean(((HLAsubscribeInteractionClassMessage)obj).HLAactive); /* * writer.WriteHLAinteger32BE((((HLAsubscribeInteractionClassMessage)obj).HLAinteractionClass).Length); * * for (int i = 0; i < (((HLAsubscribeInteractionClassMessage)obj).HLAinteractionClass).Length; i++) * { * writer.WriteHLAoctet((((HLAsubscribeInteractionClassMessage)obj).HLAinteractionClass)[i]); * } * writer.WriteHLAboolean(((HLAsubscribeInteractionClassMessage)obj).HLAactive); */ } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this HLAfederate.HLAtimeManagerState to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="HLAtimeManagerState"> the property to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object HLAtimeManagerState) { try { HLAtimeStateXrtiSerializer.Serialize(writer, (HLAtimeState)HLAtimeManagerState); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this HLArequestHandlesMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { writer.WriteHLAinteger64BE(((HLArequestHandlesMessage)obj).BlockSize); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this Boid.Velocity to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="Velocity"> the property to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object Velocity) { try { Vector3XrtiSerializer.Serialize(writer, (Vector3)Velocity); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this Boid.Color to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="Color"> the property to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object Color) { try { writer.WriteHLAunicodeString((String)Color); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this ExternalCountry.Position to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="Position"> the property to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object Position) { try { Vector3FloatStructXrtiSerializer.Serialize(writer, (Vector3FloatStruct)Position); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this ExternalCountry.Population to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object population) { try { writer.WriteHLAfloat64BE((double)population); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
public override void Serialize(HlaEncodingWriter writer, object moveDirection) { try { MoveDirectionXrtiSerializer.Serialize(writer, (Actor.MoveDirection)moveDirection); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this Home.BoxesCount to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="BoxesCount"> the property to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object BoxesCount) { try { writer.WriteHLAinteger32BE((int)BoxesCount); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this HLAfederate.HLAtimeConstrained to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="HLAtimeConstrained"> the property to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object HLAtimeConstrained) { try { writer.WriteHLAboolean((bool)HLAtimeConstrained); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this HLAfederate.HLAlogicalTime to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="HLAfederationName"> the property to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object HLAlookahead) { try { IHlaEncodingSerializer serializer = serializerManager.GetSerializer(typeof(ILogicalTimeInterval)); serializer.Serialize(writer, HLAlookahead); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this CommunicationMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { //base.Serialize(writer, obj); writer.WriteHLAunicodeString(((CommunicationMessage)obj).Message); } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this HLAdestroyFederationExecutionMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { base.Serialize(writer, obj); writer.WriteHLAunicodeString(((HLAdestroyFederationExecutionMessage)obj).FederationExecutionName); } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this HLAsubscribeObjectClassAttributesMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { base.Serialize(writer, obj); IObjectClassHandle objectClass = ((HLAsubscribeObjectClassAttributesMessage)obj).HLAobjectClass; byte[] objectClassByteArray = new byte[objectClass.EncodedLength()]; objectClass.Encode(objectClassByteArray, 0); writer.WriteHLAopaqueData(objectClassByteArray); IAttributeHandleSet attributeHandleSet = ((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList; writer.WriteHLAinteger32BE(attributeHandleSet.Count); foreach (IAttributeHandle attributeHandle in attributeHandleSet) { byte[] attributeHandleByteArray = new byte[attributeHandle.EncodedLength()]; attributeHandle.Encode(attributeHandleByteArray, 0); writer.WriteHLAopaqueData(attributeHandleByteArray); } writer.WriteHLAboolean(((HLAsubscribeObjectClassAttributesMessage)obj).HLAactive); /* * writer.WriteHLAinteger32BE((((HLAsubscribeObjectClassAttributesMessage)obj).HLAobjectClass).Length); * * for (int i = 0; i < (((HLAsubscribeObjectClassAttributesMessage)obj).HLAobjectClass).Length; i++) * { * writer.WriteHLAoctet((((HLAsubscribeObjectClassAttributesMessage)obj).HLAobjectClass)[i]); * } * writer.WriteHLAinteger32BE((((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList).Length); * * for (int i = 0; i < (((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList).Length; i++) * { * writer.WriteHLAinteger32BE(((((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList)[i]).Length); * * for (int j = 0; j < ((((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList)[i]).Length; j++) * { * writer.WriteHLAoctet(((((HLAsubscribeObjectClassAttributesMessage)obj).HLAattributeList)[i])[j]); * } * } * writer.WriteHLAboolean(((HLAsubscribeObjectClassAttributesMessage)obj).HLAactive); */ } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this HLAinteractionFragmentMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { writer.WriteHLAinteger32BE(((HLAinteractionFragmentMessage)obj).InteractionNumber); writer.WriteHLAinteger32BE(((HLAinteractionFragmentMessage)obj).InteractionSize); writer.WriteHLAinteger32BE(((HLAinteractionFragmentMessage)obj).FragmentOffset); writer.WriteHLAopaqueData(((HLAinteractionFragmentMessage)obj).FragmentContents); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this BoxInHouseMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { base.Serialize(writer, obj); byte[] logicalTimeBytesArray = ((BoxInHouseMessage)obj).Time; writer.WriteHLAopaqueData(logicalTimeBytesArray); } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this HLAregisterObjectInstanceMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { base.Serialize(writer, obj); writer.WriteHLAunicodeString(((HLAregisterObjectInstanceMessage)obj).ObjectName); writer.WriteHLAinteger64BE(((HLAregisterObjectInstanceMessage)obj).ObjectInstanceHandle); writer.WriteHLAinteger64BE(((HLAregisterObjectInstanceMessage)obj).ObjectClassHandle); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this ILogicalTime to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="HLAfederationName"> the property to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object HLAlogicalTime) { try { ILogicalTime logicalTime = (ILogicalTime)HLAlogicalTime; byte[] logicalTimeBytesArray = new byte[logicalTime.EncodedLength()]; logicalTime.Encode(logicalTimeBytesArray, 0); writer.WriteHLAopaqueData(logicalTimeBytesArray); } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this HlaGenericInteractionMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { writer.WriteHLAinteger32BE(((HLAGenericInteractionMessage)obj).ParameterList.Length); for (int i = 0; i < ((HLAGenericInteractionMessage)obj).ParameterList.Length; i++) { HLAparameterHandleValuePairXrtiSerializer.Serialize(writer, ((HLAGenericInteractionMessage)obj).ParameterList[i]); } } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> /// Writes this HLAparameterHandleValuePair to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { BaseInteractionMessage msg = obj as BaseInteractionMessage; writer.WriteHLAinteger64BE(msg.FederateHandle); writer.WriteHLAinteger64BE(msg.InteractionIndex); writer.WriteHLAinteger64BE(msg.FederationExecutionHandle); writer.WriteHLAopaqueData(msg.UserSuppliedTag); writer.WriteHLAinteger64BE(msg.InteractionClassHandle); IHlaEncodingSerializer serializer = serializerManager.GetSerializer(msg.InteractionClassHandle); if (serializer != null && !this.Equals(serializer)) { serializer.Serialize(writer, obj); } }
///<summary> Writes this HLArequestAttributeValueUpdateMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { writer.WriteHLAinteger64BE(((HLArequestAttributeValueUpdateMessage)obj).ObjectInstanceHandle); writer.WriteHLAinteger32BE(((HLArequestAttributeValueUpdateMessage)obj).AttributeHandleList.Length); for (int i = 0; i < ((HLArequestAttributeValueUpdateMessage)obj).AttributeHandleList.Length; i++) { writer.WriteHLAinteger64BE(((HLArequestAttributeValueUpdateMessage)obj).AttributeHandleList[i]); } } catch (IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this PeerAdvertisementInteractionMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { writer.WriteHLAunicodeString(((PeerAdvertisementInteractionMessage)obj).PeerName); writer.WriteHLAunicodeString(((PeerAdvertisementInteractionMessage)obj).PeerDescription); writer.WriteHLAinteger32BE((((PeerAdvertisementInteractionMessage)obj).PeerChannels).Count); for (int i = 0; i < (((PeerAdvertisementInteractionMessage)obj).PeerChannels).Count; i++) { writer.WriteHLAunicodeString((((PeerAdvertisementInteractionMessage)obj).PeerChannels)[i]); } } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this HLAupdateAttributeValuesMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { base.Serialize(writer, obj); writer.WriteHLAinteger64BE(((HLAupdateAttributeValuesMessage)obj).ObjectInstanceHandle); writer.WriteHLAinteger32BE((((HLAupdateAttributeValuesMessage)obj).AttributeHandleValuePairList).Length); for (int i = 0; i < (((HLAupdateAttributeValuesMessage)obj).AttributeHandleValuePairList).Length; i++) { hlaAttributeHandleValuePairXrtiSerializer.Serialize(writer, ((HLAupdateAttributeValuesMessage)obj).AttributeHandleValuePairList[i]); } } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
///<summary> Writes this HLAfederateMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { try { base.Serialize(writer, obj); int val = (((HLAfederateMessage)obj).HLAfederate).data; writer.WriteHLAinteger32BE(val); /* * writer.WriteHLAinteger32BE((((HLAfederateMessage)obj).HLAfederate).Length); * * for (int i = 0; i < (((HLAfederateMessage)obj).HLAfederate).Length; i++) * { * writer.WriteHLAoctet((((HLAfederateMessage)obj).HLAfederate)[i]); * } */ } catch (System.IO.IOException ioe) { throw new RTIinternalError(ioe.ToString()); } }
public static void Serialize(HlaEncodingWriter writer, Actor.MoveDirection val) { writer.WriteHLAinteger32BE((int)val); }
///<summary> /// Writes this Vector3FloatStruct to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public static void Serialize(HlaEncodingWriter writer, Vector3 obj) { writer.WriteHLAfloat32BE(obj.x); writer.WriteHLAfloat32BE(obj.y); writer.WriteHLAfloat32BE(obj.z); }
///<summary>Writes this HLAtimeState to the specified stream.</summary> ///<param name="writer"> the stream to write to</param> ///<exception cref="IOException"> if an error occurs</exception> public static void Serialize(HlaEncodingWriter writer, HLAtimeState val) { writer.WriteHLAinteger32BE((int)val); }
///<summary> Writes this HLAinteractionRootMessage to the specified stream.</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="System.IO.IOException"> if an error occurs</exception> public override void Serialize(HlaEncodingWriter writer, object obj) { }
///<summary> /// Writes this Vector3FloatStruct to the specified stream. ///</summary> ///<param name="writer"> the output stream to write to</param> ///<param name="obj"> the object to serialize</param> ///<exception cref="IOException"> if an error occurs</exception> public static void Serialize(HlaEncodingWriter writer, Vector3FloatStruct obj) { writer.WriteHLAfloat32BE(obj.XComponent); writer.WriteHLAfloat32BE(obj.YComponent); writer.WriteHLAfloat32BE(obj.ZComponent); }