new public int getMarshalledSize() { int marshalSize = 0; marshalSize = base.getMarshalledSize(); marshalSize = marshalSize + _aggregateID.getMarshalledSize(); // _aggregateID marshalSize = marshalSize + 1; // _forceID marshalSize = marshalSize + 1; // _aggregateState marshalSize = marshalSize + _aggregateType.getMarshalledSize(); // _aggregateType marshalSize = marshalSize + 4; // _formation marshalSize = marshalSize + _aggregateMarking.getMarshalledSize(); // _aggregateMarking marshalSize = marshalSize + _dimensions.getMarshalledSize(); // _dimensions marshalSize = marshalSize + _orientation.getMarshalledSize(); // _orientation marshalSize = marshalSize + _centerOfMass.getMarshalledSize(); // _centerOfMass marshalSize = marshalSize + _velocity.getMarshalledSize(); // _velocity marshalSize = marshalSize + 2; // _numberOfDisAggregates marshalSize = marshalSize + 2; // _numberOfDisEntities marshalSize = marshalSize + 2; // _numberOfSilentAggregateTypes marshalSize = marshalSize + 2; // _numberOfSilentEntityTypes for (int idx = 0; idx < _aggregateIDList.Count; idx++) { AggregateID listElement = (AggregateID)_aggregateIDList[idx]; marshalSize = marshalSize + listElement.getMarshalledSize(); } for (int idx = 0; idx < _entityIDList.Count; idx++) { EntityID listElement = (EntityID)_entityIDList[idx]; marshalSize = marshalSize + listElement.getMarshalledSize(); } marshalSize = marshalSize + 1; // _pad2 for (int idx = 0; idx < _silentAggregateSystemList.Count; idx++) { EntityType listElement = (EntityType)_silentAggregateSystemList[idx]; marshalSize = marshalSize + listElement.getMarshalledSize(); } for (int idx = 0; idx < _silentEntitySystemList.Count; idx++) { EntityType listElement = (EntityType)_silentEntitySystemList[idx]; marshalSize = marshalSize + listElement.getMarshalledSize(); } marshalSize = marshalSize + 4; // _numberOfVariableDatumRecords for (int idx = 0; idx < _variableDatumList.Count; idx++) { VariableDatum listElement = (VariableDatum)_variableDatumList[idx]; marshalSize = marshalSize + listElement.getMarshalledSize(); } return(marshalSize); }
/** * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful. */ public bool equals(EntityID rhs) { bool ivarsEqual = true; if (rhs.GetType() != this.GetType()) { return(false); } if (!(_site == rhs._site)) { ivarsEqual = false; } if (!(_application == rhs._application)) { ivarsEqual = false; } if (!(_entity == rhs._entity)) { ivarsEqual = false; } return(ivarsEqual); }
} // end of marshal method new public void unmarshal(DataInputStream dis) { base.unmarshal(dis); try { _aggregateID.unmarshal(dis); _forceID = dis.readByte(); _aggregateState = dis.readByte(); _aggregateType.unmarshal(dis); _formation = dis.readUint(); _aggregateMarking.unmarshal(dis); _dimensions.unmarshal(dis); _orientation.unmarshal(dis); _centerOfMass.unmarshal(dis); _velocity.unmarshal(dis); _numberOfDisAggregates = dis.readUshort(); _numberOfDisEntities = dis.readUshort(); _numberOfSilentAggregateTypes = dis.readUshort(); _numberOfSilentEntityTypes = dis.readUshort(); for (int idx = 0; idx < _numberOfDisAggregates; idx++) { AggregateID anX = new AggregateID(); anX.unmarshal(dis); _aggregateIDList.Add(anX); } ; for (int idx = 0; idx < _numberOfDisEntities; idx++) { EntityID anX = new EntityID(); anX.unmarshal(dis); _entityIDList.Add(anX); } ; _pad2 = dis.readByte(); for (int idx = 0; idx < _numberOfSilentAggregateTypes; idx++) { EntityType anX = new EntityType(); anX.unmarshal(dis); _silentAggregateSystemList.Add(anX); } ; for (int idx = 0; idx < _numberOfSilentEntityTypes; idx++) { EntityType anX = new EntityType(); anX.unmarshal(dis); _silentEntitySystemList.Add(anX); } ; _numberOfVariableDatumRecords = dis.readUint(); for (int idx = 0; idx < _numberOfVariableDatumRecords; idx++) { VariableDatum anX = new VariableDatum(); anX.unmarshal(dis); _variableDatumList.Add(anX); } ; } // end try catch (Exception e) { Trace.WriteLine(e); Trace.Flush(); } } // end of unmarshal method
///<summary> ///ID of aggregated entities ///</summary> public void setGroupEntityID(EntityID pGroupEntityID) { _groupEntityID = pGroupEntityID; }
///<summary> ///ID of aggregated entities ///</summary> public void setAggregateID(EntityID pAggregateID) { _aggregateID = pAggregateID; }
/** * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful. */ public bool equals(EntityID rhs) { bool ivarsEqual = true; if(rhs.GetType() != this.GetType()) return false; if( ! (_site == rhs._site)) ivarsEqual = false; if( ! (_application == rhs._application)) ivarsEqual = false; if( ! (_entity == rhs._entity)) ivarsEqual = false; return ivarsEqual; }
///<summary> ///Entity that is supplying ///</summary> public void setSupplyingEntityID(EntityID pSupplyingEntityID) { _supplyingEntityID = pSupplyingEntityID; }
///<summary> ///Object in synthetic environment ///</summary> public void setObjectID(EntityID pObjectID) { _objectID = pObjectID; }
///<summary> ///entity ID making the request ///</summary> public void setRequestingEntityID(EntityID pRequestingEntityID) { _requestingEntityID = pRequestingEntityID; }
///<summary> ///Environmental process ID ///</summary> public void setEnvironementalProcessID(EntityID pEnvironementalProcessID) { _environementalProcessID = pEnvironementalProcessID; }
///<summary> ///ID of muntion that was fired ///</summary> public void setMunitionID(EntityID pMunitionID) { _munitionID = pMunitionID; }
///<summary> ///ID of the entity that issued the collision PDU ///</summary> public void setIssuingEntityID(EntityID pIssuingEntityID) { _issuingEntityID = pIssuingEntityID; }
///<summary> ///ID of entity that has collided with the issuing entity ID ///</summary> public void setCollidingEntityID(EntityID pCollidingEntityID) { _collidingEntityID = pCollidingEntityID; }
///<summary> ///eid of the entity that has created this intercom channel. ///</summary> public void setMasterEntityID(EntityID pMasterEntityID) { _masterEntityID = pMasterEntityID; }
///<summary> ///ID of the entity that is the source of the emission ///</summary> public void setEmittingEntityID(EntityID pEmittingEntityID) { _emittingEntityID = pEmittingEntityID; }
///<summary> ///track/jam target ///</summary> public void setTrackJam(EntityID pTrackJam) { _trackJam = pTrackJam; }
///<summary> ///Entity that is supplying ///</summary> public void setRepairingEntityID(EntityID pRepairingEntityID) { _repairingEntityID = pRepairingEntityID; }
///<summary> ///ID of the entity that is being shot at ///</summary> public void setTargetEntityID(EntityID pTargetEntityID) { _targetEntityID = pTargetEntityID; }
///<summary> ///Originating entity ID ///</summary> public void setOrginatingEntityID(EntityID pOrginatingEntityID) { _orginatingEntityID = pOrginatingEntityID; }
///<summary> ///ID of transmitter ///</summary> public void setTransmitterEntityId(EntityID pTransmitterEntityId) { _transmitterEntityId = pTransmitterEntityId; }
///<summary> ///ID of the entity that is the source of the emissions ///</summary> public void setEmittingEntityId(EntityID pEmittingEntityId) { _emittingEntityId = pEmittingEntityId; }
///<summary> ///ID of the entity designating ///</summary> public void setDesignatingEntityID(EntityID pDesignatingEntityID) { _designatingEntityID = pDesignatingEntityID; }
///<summary> ///The entity for which control is being requested to transfer ///</summary> public void setTransferEntityID(EntityID pTransferEntityID) { _transferEntityID = pTransferEntityID; }
///<summary> ///Minefield ID ///</summary> public void setMinefieldID(EntityID pMinefieldID) { _minefieldID = pMinefieldID; }
///<summary> ///environmental simulation application ID ///</summary> public void setEnvironmentalSimulationApplicationID(EntityID pEnvironmentalSimulationApplicationID) { _environmentalSimulationApplicationID = pEnvironmentalSimulationApplicationID; }
///<summary> ///Marshal the data to the DataOutputStream. Note: Length needs to be set before calling this method ///</summary> new public void marshal(DataOutputStream dos) { base.marshal(dos); try { _aggregateID.marshal(dos); dos.writeByte((byte)_forceID); dos.writeByte((byte)_aggregateState); _aggregateType.marshal(dos); dos.writeUint((uint)_formation); _aggregateMarking.marshal(dos); _dimensions.marshal(dos); _orientation.marshal(dos); _centerOfMass.marshal(dos); _velocity.marshal(dos); dos.writeUshort((ushort)_aggregateIDList.Count); dos.writeUshort((ushort)_entityIDList.Count); dos.writeUshort((ushort)_silentAggregateSystemList.Count); dos.writeUshort((ushort)_silentEntitySystemList.Count); for (int idx = 0; idx < _aggregateIDList.Count; idx++) { AggregateID aAggregateID = (AggregateID)_aggregateIDList[idx]; aAggregateID.marshal(dos); } // end of list marshalling for (int idx = 0; idx < _entityIDList.Count; idx++) { EntityID aEntityID = (EntityID)_entityIDList[idx]; aEntityID.marshal(dos); } // end of list marshalling dos.writeByte((byte)_pad2); for (int idx = 0; idx < _silentAggregateSystemList.Count; idx++) { EntityType aEntityType = (EntityType)_silentAggregateSystemList[idx]; aEntityType.marshal(dos); } // end of list marshalling for (int idx = 0; idx < _silentEntitySystemList.Count; idx++) { EntityType aEntityType = (EntityType)_silentEntitySystemList[idx]; aEntityType.marshal(dos); } // end of list marshalling dos.writeUint((uint)_variableDatumList.Count); for (int idx = 0; idx < _variableDatumList.Count; idx++) { VariableDatum aVariableDatum = (VariableDatum)_variableDatumList[idx]; aVariableDatum.marshal(dos); } // end of list marshalling } // end try catch (Exception e) { Trace.WriteLine(e); Trace.Flush(); } } // end of marshal method
///<summary> ///Entity that is providing the service ///</summary> public void setServicingEntityID(EntityID pServicingEntityID) { _servicingEntityID = pServicingEntityID; }
} // end of unmarshal method ///<summary> ///This allows for a quick display of PDU data. The current format is unacceptable and only used for debugging. ///This will be modified in the future to provide a better display. Usage: ///pdu.GetType().InvokeMember("reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb }); ///where pdu is an object representing a single pdu and sb is a StringBuilder. ///Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality ///</summary> new public void reflection(StringBuilder sb) { sb.Append("<AggregateStatePdu>" + System.Environment.NewLine); base.reflection(sb); try { sb.Append("<aggregateID>" + System.Environment.NewLine); _aggregateID.reflection(sb); sb.Append("</aggregateID>" + System.Environment.NewLine); sb.Append("<forceID type=\"byte\">" + _forceID.ToString() + "</forceID> " + System.Environment.NewLine); sb.Append("<aggregateState type=\"byte\">" + _aggregateState.ToString() + "</aggregateState> " + System.Environment.NewLine); sb.Append("<aggregateType>" + System.Environment.NewLine); _aggregateType.reflection(sb); sb.Append("</aggregateType>" + System.Environment.NewLine); sb.Append("<formation type=\"uint\">" + _formation.ToString() + "</formation> " + System.Environment.NewLine); sb.Append("<aggregateMarking>" + System.Environment.NewLine); _aggregateMarking.reflection(sb); sb.Append("</aggregateMarking>" + System.Environment.NewLine); sb.Append("<dimensions>" + System.Environment.NewLine); _dimensions.reflection(sb); sb.Append("</dimensions>" + System.Environment.NewLine); sb.Append("<orientation>" + System.Environment.NewLine); _orientation.reflection(sb); sb.Append("</orientation>" + System.Environment.NewLine); sb.Append("<centerOfMass>" + System.Environment.NewLine); _centerOfMass.reflection(sb); sb.Append("</centerOfMass>" + System.Environment.NewLine); sb.Append("<velocity>" + System.Environment.NewLine); _velocity.reflection(sb); sb.Append("</velocity>" + System.Environment.NewLine); sb.Append("<aggregateIDList type=\"ushort\">" + _aggregateIDList.Count.ToString() + "</aggregateIDList> " + System.Environment.NewLine); sb.Append("<entityIDList type=\"ushort\">" + _entityIDList.Count.ToString() + "</entityIDList> " + System.Environment.NewLine); sb.Append("<silentAggregateSystemList type=\"ushort\">" + _silentAggregateSystemList.Count.ToString() + "</silentAggregateSystemList> " + System.Environment.NewLine); sb.Append("<silentEntitySystemList type=\"ushort\">" + _silentEntitySystemList.Count.ToString() + "</silentEntitySystemList> " + System.Environment.NewLine); for (int idx = 0; idx < _aggregateIDList.Count; idx++) { sb.Append("<aggregateIDList" + idx.ToString() + " type=\"AggregateID\">" + System.Environment.NewLine); AggregateID aAggregateID = (AggregateID)_aggregateIDList[idx]; aAggregateID.reflection(sb); sb.Append("</aggregateIDList" + idx.ToString() + ">" + System.Environment.NewLine); } // end of list marshalling for (int idx = 0; idx < _entityIDList.Count; idx++) { sb.Append("<entityIDList" + idx.ToString() + " type=\"EntityID\">" + System.Environment.NewLine); EntityID aEntityID = (EntityID)_entityIDList[idx]; aEntityID.reflection(sb); sb.Append("</entityIDList" + idx.ToString() + ">" + System.Environment.NewLine); } // end of list marshalling sb.Append("<pad2 type=\"byte\">" + _pad2.ToString() + "</pad2> " + System.Environment.NewLine); for (int idx = 0; idx < _silentAggregateSystemList.Count; idx++) { sb.Append("<silentAggregateSystemList" + idx.ToString() + " type=\"EntityType\">" + System.Environment.NewLine); EntityType aEntityType = (EntityType)_silentAggregateSystemList[idx]; aEntityType.reflection(sb); sb.Append("</silentAggregateSystemList" + idx.ToString() + ">" + System.Environment.NewLine); } // end of list marshalling for (int idx = 0; idx < _silentEntitySystemList.Count; idx++) { sb.Append("<silentEntitySystemList" + idx.ToString() + " type=\"EntityType\">" + System.Environment.NewLine); EntityType aEntityType = (EntityType)_silentEntitySystemList[idx]; aEntityType.reflection(sb); sb.Append("</silentEntitySystemList" + idx.ToString() + ">" + System.Environment.NewLine); } // end of list marshalling sb.Append("<variableDatumList type=\"uint\">" + _variableDatumList.Count.ToString() + "</variableDatumList> " + System.Environment.NewLine); for (int idx = 0; idx < _variableDatumList.Count; idx++) { sb.Append("<variableDatumList" + idx.ToString() + " type=\"VariableDatum\">" + System.Environment.NewLine); VariableDatum aVariableDatum = (VariableDatum)_variableDatumList[idx]; aVariableDatum.reflection(sb); sb.Append("</variableDatumList" + idx.ToString() + ">" + System.Environment.NewLine); } // end of list marshalling sb.Append("</AggregateStatePdu>" + System.Environment.NewLine); } // end try catch (Exception e) { Trace.WriteLine(e); Trace.Flush(); } } // end of marshal method
///<summary> ///ID of the entity that shot ///</summary> public void setFiringEntityID(EntityID pFiringEntityID) { _firingEntityID = pFiringEntityID; }
///<summary> ///ID of the entitythat is the source of the communication ///</summary> public void setEntityId(EntityID pEntityId) { _entityId = pEntityId; }
///<summary> ///Object with which this point object is associated ///</summary> public void setReferencedObjectID(EntityID pReferencedObjectID) { _referencedObjectID = pReferencedObjectID; }
///<summary> ///Source entity ID ///</summary> public void setSourceEntityID(EntityID pSourceEntityID) { _sourceEntityID = pSourceEntityID; }
///<summary> ///Unique ID for an entity that is tied to this state information ///</summary> public void setEntityID(EntityID pEntityID) { _entityID = pEntityID; }
///<summary> ///Entity that is receiving service ///</summary> public void setReceivingEntityID(EntityID pReceivingEntityID) { _receivingEntityID = pReceivingEntityID; }
///<summary> ///ID of the entity being designated ///</summary> public void setDesignatedEntityID(EntityID pDesignatedEntityID) { _designatedEntityID = pDesignatedEntityID; }
/** * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful. */ public bool equals(AggregateStatePdu rhs) { bool ivarsEqual = true; if (rhs.GetType() != this.GetType()) { return(false); } if (!(_aggregateID.Equals(rhs._aggregateID))) { ivarsEqual = false; } if (!(_forceID == rhs._forceID)) { ivarsEqual = false; } if (!(_aggregateState == rhs._aggregateState)) { ivarsEqual = false; } if (!(_aggregateType.Equals(rhs._aggregateType))) { ivarsEqual = false; } if (!(_formation == rhs._formation)) { ivarsEqual = false; } if (!(_aggregateMarking.Equals(rhs._aggregateMarking))) { ivarsEqual = false; } if (!(_dimensions.Equals(rhs._dimensions))) { ivarsEqual = false; } if (!(_orientation.Equals(rhs._orientation))) { ivarsEqual = false; } if (!(_centerOfMass.Equals(rhs._centerOfMass))) { ivarsEqual = false; } if (!(_velocity.Equals(rhs._velocity))) { ivarsEqual = false; } if (!(_numberOfDisAggregates == rhs._numberOfDisAggregates)) { ivarsEqual = false; } if (!(_numberOfDisEntities == rhs._numberOfDisEntities)) { ivarsEqual = false; } if (!(_numberOfSilentAggregateTypes == rhs._numberOfSilentAggregateTypes)) { ivarsEqual = false; } if (!(_numberOfSilentEntityTypes == rhs._numberOfSilentEntityTypes)) { ivarsEqual = false; } for (int idx = 0; idx < _aggregateIDList.Count; idx++) { AggregateID x = (AggregateID)_aggregateIDList[idx]; if (!(_aggregateIDList[idx].Equals(rhs._aggregateIDList[idx]))) { ivarsEqual = false; } } for (int idx = 0; idx < _entityIDList.Count; idx++) { EntityID x = (EntityID)_entityIDList[idx]; if (!(_entityIDList[idx].Equals(rhs._entityIDList[idx]))) { ivarsEqual = false; } } if (!(_pad2 == rhs._pad2)) { ivarsEqual = false; } for (int idx = 0; idx < _silentAggregateSystemList.Count; idx++) { EntityType x = (EntityType)_silentAggregateSystemList[idx]; if (!(_silentAggregateSystemList[idx].Equals(rhs._silentAggregateSystemList[idx]))) { ivarsEqual = false; } } for (int idx = 0; idx < _silentEntitySystemList.Count; idx++) { EntityType x = (EntityType)_silentEntitySystemList[idx]; if (!(_silentEntitySystemList[idx].Equals(rhs._silentEntitySystemList[idx]))) { ivarsEqual = false; } } if (!(_numberOfVariableDatumRecords == rhs._numberOfVariableDatumRecords)) { ivarsEqual = false; } for (int idx = 0; idx < _variableDatumList.Count; idx++) { VariableDatum x = (VariableDatum)_variableDatumList[idx]; if (!(_variableDatumList[idx].Equals(rhs._variableDatumList[idx]))) { ivarsEqual = false; } } return(ivarsEqual); }
public new void unmarshal(DataInputStream dis) { base.unmarshal(dis); try { _aggregateID.unmarshal(dis); _forceID = dis.readByte(); _aggregateState = dis.readByte(); _aggregateType.unmarshal(dis); _formation = dis.readUint(); _aggregateMarking.unmarshal(dis); _dimensions.unmarshal(dis); _orientation.unmarshal(dis); _centerOfMass.unmarshal(dis); _velocity.unmarshal(dis); _numberOfDisAggregates = dis.readUshort(); _numberOfDisEntities = dis.readUshort(); _numberOfSilentAggregateTypes = dis.readUshort(); _numberOfSilentEntityTypes = dis.readUshort(); for(int idx = 0; idx < _numberOfDisAggregates; idx++) { AggregateID anX = new AggregateID(); anX.unmarshal(dis); _aggregateIDList.Add(anX); }; for(int idx = 0; idx < _numberOfDisEntities; idx++) { EntityID anX = new EntityID(); anX.unmarshal(dis); _entityIDList.Add(anX); }; _pad2 = dis.readByte(); for(int idx = 0; idx < _numberOfSilentAggregateTypes; idx++) { EntityType anX = new EntityType(); anX.unmarshal(dis); _silentAggregateSystemList.Add(anX); }; for(int idx = 0; idx < _numberOfSilentEntityTypes; idx++) { EntityType anX = new EntityType(); anX.unmarshal(dis); _silentEntitySystemList.Add(anX); }; _numberOfVariableDatumRecords = dis.readUint(); for(int idx = 0; idx < _numberOfVariableDatumRecords; idx++) { VariableDatum anX = new VariableDatum(); anX.unmarshal(dis); _variableDatumList.Add(anX); }; } // end try catch(Exception e) { Trace.WriteLine(e); Trace.Flush(); } }