Exemplo n.º 1
0
        } // end of marshal method

        new public void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
                _objectID.unmarshal(dis);
                _referencedObjectID.unmarshal(dis);
                _updateNumber  = dis.readUshort();
                _forceID       = dis.readByte();
                _modifications = dis.readByte();
                _objectType.unmarshal(dis);
                _objectAppearance.unmarshal(dis);
                _numberOfPoints = dis.readUshort();
                _requesterID.unmarshal(dis);
                _receivingID.unmarshal(dis);
                for (int idx = 0; idx < _numberOfPoints; idx++)
                {
                    Vector3Double anX = new Vector3Double();
                    anX.unmarshal(dis);
                    _objectLocation.Add(anX);
                }
                ;
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of unmarshal method
Exemplo n.º 2
0
        /**
         * Compares for reference equality and value equality.
         */
        public bool equals(Vector3Double rhs)
        {
            bool ivarsEqual = true;

            if (rhs.GetType() != this.GetType())
            {
                return(false);
            }


            if (!(_x == rhs._x))
            {
                ivarsEqual = false;
            }
            if (!(_y == rhs._y))
            {
                ivarsEqual = false;
            }
            if (!(_z == rhs._z))
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
Exemplo n.º 3
0
///<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
            {
                _objectID.marshal(dos);
                _referencedObjectID.marshal(dos);
                dos.writeUshort((ushort)_updateNumber);
                dos.writeByte((byte)_forceID);
                dos.writeByte((byte)_modifications);
                _objectType.marshal(dos);
                _objectAppearance.marshal(dos);
                dos.writeUshort((ushort)_objectLocation.Count);
                _requesterID.marshal(dos);
                _receivingID.marshal(dos);

                for (int idx = 0; idx < _objectLocation.Count; idx++)
                {
                    Vector3Double aVector3Double = (Vector3Double)_objectLocation[idx];
                    aVector3Double.marshal(dos);
                } // end of list marshalling
            }     // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
Exemplo n.º 4
0
        } // 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("<ArealObjectStatePdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<objectID>" + System.Environment.NewLine);
                _objectID.reflection(sb);
                sb.Append("</objectID>" + System.Environment.NewLine);
                sb.Append("<referencedObjectID>" + System.Environment.NewLine);
                _referencedObjectID.reflection(sb);
                sb.Append("</referencedObjectID>" + System.Environment.NewLine);
                sb.Append("<updateNumber type=\"ushort\">" + _updateNumber.ToString() + "</updateNumber> " + System.Environment.NewLine);
                sb.Append("<forceID type=\"byte\">" + _forceID.ToString() + "</forceID> " + System.Environment.NewLine);
                sb.Append("<modifications type=\"byte\">" + _modifications.ToString() + "</modifications> " + System.Environment.NewLine);
                sb.Append("<objectType>" + System.Environment.NewLine);
                _objectType.reflection(sb);
                sb.Append("</objectType>" + System.Environment.NewLine);
                sb.Append("<objectAppearance>" + System.Environment.NewLine);
                _objectAppearance.reflection(sb);
                sb.Append("</objectAppearance>" + System.Environment.NewLine);
                sb.Append("<objectLocation type=\"ushort\">" + _objectLocation.Count.ToString() + "</objectLocation> " + System.Environment.NewLine);
                sb.Append("<requesterID>" + System.Environment.NewLine);
                _requesterID.reflection(sb);
                sb.Append("</requesterID>" + System.Environment.NewLine);
                sb.Append("<receivingID>" + System.Environment.NewLine);
                _receivingID.reflection(sb);
                sb.Append("</receivingID>" + System.Environment.NewLine);

                for (int idx = 0; idx < _objectLocation.Count; idx++)
                {
                    sb.Append("<objectLocation" + idx.ToString() + " type=\"Vector3Double\">" + System.Environment.NewLine);
                    Vector3Double aVector3Double = (Vector3Double)_objectLocation[idx];
                    aVector3Double.reflection(sb);
                    sb.Append("</objectLocation" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling

                sb.Append("</ArealObjectStatePdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
Exemplo n.º 5
0
        new public int getMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize = base.getMarshalledSize();
            marshalSize = marshalSize + _objectID.getMarshalledSize();           // _objectID
            marshalSize = marshalSize + _referencedObjectID.getMarshalledSize(); // _referencedObjectID
            marshalSize = marshalSize + 2;                                       // _updateNumber
            marshalSize = marshalSize + 1;                                       // _forceID
            marshalSize = marshalSize + 1;                                       // _modifications
            marshalSize = marshalSize + _objectType.getMarshalledSize();         // _objectType
            marshalSize = marshalSize + _objectAppearance.getMarshalledSize();   // _objectAppearance
            marshalSize = marshalSize + 2;                                       // _numberOfPoints
            marshalSize = marshalSize + _requesterID.getMarshalledSize();        // _requesterID
            marshalSize = marshalSize + _receivingID.getMarshalledSize();        // _receivingID
            for (int idx = 0; idx < _objectLocation.Count; idx++)
            {
                Vector3Double listElement = (Vector3Double)_objectLocation[idx];
                marshalSize = marshalSize + listElement.getMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 6
0
        /**
          * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
          */
        public bool equals(Vector3Double rhs)
        {
            bool ivarsEqual = true;

            if(rhs.GetType() != this.GetType())
            return false;

             if( ! (_x == rhs._x)) ivarsEqual = false;
             if( ! (_y == rhs._y)) ivarsEqual = false;
             if( ! (_z == rhs._z)) ivarsEqual = false;

            return ivarsEqual;
        }
Exemplo n.º 7
0
 ///<summary>
 ///describes the location of the entity in the world
 ///</summary>
 public void setEntityLocation(Vector3Double pEntityLocation)
 {
     _entityLocation = pEntityLocation;
 }
Exemplo n.º 8
0
 ///<summary>
 ///Location of antenna
 ///</summary>
 public void setAntennaLocation(Vector3Double pAntennaLocation)
 {
     _antennaLocation = pAntennaLocation;
 }
Exemplo n.º 9
0
 ///<summary>
 ///describes the location of the entity in the world
 ///</summary>
 public void setEntityLocation(Vector3Double pEntityLocation)
 {
     _entityLocation = pEntityLocation;
 }
Exemplo n.º 10
0
 ///<summary>
 ///designtor spot wrt the designated entity
 ///</summary>
 public void setDesignatorSpotLocation(Vector3Double pDesignatorSpotLocation)
 {
     _designatorSpotLocation = pDesignatorSpotLocation;
 }
Exemplo n.º 11
0
 ///<summary>
 ///location of minefield in world coords
 ///</summary>
 public void setMinefieldLocation(Vector3Double pMinefieldLocation)
 {
     _minefieldLocation = pMinefieldLocation;
 }
Exemplo n.º 12
0
 ///<summary>
 ///location
 ///</summary>
 public void setLocation(Vector3Double pLocation)
 {
     _location = pLocation;
 }
 ///<summary>
 ///location
 ///</summary>
 public void setLocation(Vector3Double pLocation)
 {
     _location = pLocation;
 }
Exemplo n.º 14
0
 ///<summary>
 ///designtor spot wrt the designated entity
 ///</summary>
 public void setDesignatorSpotLocation(Vector3Double pDesignatorSpotLocation)
 {
     _designatorSpotLocation = pDesignatorSpotLocation;
 }
Exemplo n.º 15
0
 ///<summary>
 ///where the detonation is, in world coordinates
 ///</summary>
 public void setLocationInWorldCoordinates(Vector3Double pLocationInWorldCoordinates)
 {
     _locationInWorldCoordinates = pLocationInWorldCoordinates;
 }
Exemplo n.º 16
0
 ///<summary>
 ///center of mass of the aggregation
 ///</summary>
 public void setCenterOfMass(Vector3Double pCenterOfMass)
 {
     _centerOfMass = pCenterOfMass;
 }
Exemplo n.º 17
0
        /**
         * The equals method doesn't always work--mostly on on classes that consist only of primitives. Be careful.
         */
        public bool equals(ArealObjectStatePdu rhs)
        {
            bool ivarsEqual = true;

            if (rhs.GetType() != this.GetType())
            {
                return(false);
            }

            if (!(_objectID.Equals(rhs._objectID)))
            {
                ivarsEqual = false;
            }
            if (!(_referencedObjectID.Equals(rhs._referencedObjectID)))
            {
                ivarsEqual = false;
            }
            if (!(_updateNumber == rhs._updateNumber))
            {
                ivarsEqual = false;
            }
            if (!(_forceID == rhs._forceID))
            {
                ivarsEqual = false;
            }
            if (!(_modifications == rhs._modifications))
            {
                ivarsEqual = false;
            }
            if (!(_objectType.Equals(rhs._objectType)))
            {
                ivarsEqual = false;
            }
            if (!(_objectAppearance.Equals(rhs._objectAppearance)))
            {
                ivarsEqual = false;
            }
            if (!(_numberOfPoints == rhs._numberOfPoints))
            {
                ivarsEqual = false;
            }
            if (!(_requesterID.Equals(rhs._requesterID)))
            {
                ivarsEqual = false;
            }
            if (!(_receivingID.Equals(rhs._receivingID)))
            {
                ivarsEqual = false;
            }

            for (int idx = 0; idx < _objectLocation.Count; idx++)
            {
                Vector3Double x = (Vector3Double)_objectLocation[idx];
                if (!(_objectLocation[idx].Equals(rhs._objectLocation[idx])))
                {
                    ivarsEqual = false;
                }
            }


            return(ivarsEqual);
        }
Exemplo n.º 18
0
 ///<summary>
 ///where the detonation is, in world coordinates
 ///</summary>
 public void setLocationInWorldCoordinates(Vector3Double pLocationInWorldCoordinates)
 {
     _locationInWorldCoordinates = pLocationInWorldCoordinates;
 }
Exemplo n.º 19
0
 ///<summary>
 ///Location of the radiating portion of the antenna in world    coordinates
 ///</summary>
 public void setAntennaLocation(Vector3Double pAntennaLocation)
 {
     _antennaLocation = pAntennaLocation;
 }
Exemplo n.º 20
0
 ///<summary>
 ///center of mass of the aggregation
 ///</summary>
 public void setCenterOfMass(Vector3Double pCenterOfMass)
 {
     _centerOfMass = pCenterOfMass;
 }
Exemplo n.º 21
0
 ///<summary>
 ///Object location
 ///</summary>
 public void setObjectLocation(Vector3Double pObjectLocation)
 {
     _objectLocation = pObjectLocation;
 }
 ///<summary>
 ///Object location
 ///</summary>
 public void setObjectLocation(Vector3Double pObjectLocation)
 {
     _objectLocation = pObjectLocation;
 }
Exemplo n.º 23
0
 ///<summary>
 ///location of minefield in world coords
 ///</summary>
 public void setMinefieldLocation(Vector3Double pMinefieldLocation)
 {
     _minefieldLocation = pMinefieldLocation;
 }
        public new void unmarshal(DataInputStream dis)
        {
            base.unmarshal(dis);

            try
            {
               _objectID.unmarshal(dis);
               _referencedObjectID.unmarshal(dis);
               _updateNumber = dis.readUshort();
               _forceID = dis.readByte();
               _modifications = dis.readByte();
               _objectType.unmarshal(dis);
               _objectAppearance.unmarshal(dis);
               _numberOfPoints = dis.readUshort();
               _requesterID.unmarshal(dis);
               _receivingID.unmarshal(dis);
            for(int idx = 0; idx < _numberOfPoints; idx++)
            {
               Vector3Double anX = new Vector3Double();
            anX.unmarshal(dis);
            _objectLocation.Add(anX);
            };

            } // end try
               catch(Exception e)
            {
              Trace.WriteLine(e);
              Trace.Flush();
            }
        }