示例#1
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._explodingEntityID.Unmarshal(dis);
                    this._eventID.Unmarshal(dis);
                    this._velocity.Unmarshal(dis);
                    this._locationInWorldCoordinates.Unmarshal(dis);
                    this._descriptor.Unmarshal(dis);
                    this._locationOfEntityCoordinates.Unmarshal(dis);
                    this._detonationResult           = dis.ReadUnsignedByte();
                    this._numberOfVariableParameters = dis.ReadUnsignedByte();
                    this._pad = dis.ReadUnsignedShort();
                    for (int idx = 0; idx < this.NumberOfVariableParameters; idx++)
                    {
                        VariableParameter anX = new VariableParameter();
                        anX.Unmarshal(dis);
                        this._variableParameters.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
示例#2
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._entityID.Unmarshal(dis);
                    this._padding1 = dis.ReadByte();
                    this._numberOfVariableParameters = dis.ReadUnsignedByte();
                    this._entityLinearVelocity.Unmarshal(dis);
                    this._entityLocation.Unmarshal(dis);
                    this._entityOrientation.Unmarshal(dis);
                    this._entityAppearance = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.NumberOfVariableParameters; idx++)
                    {
                        VariableParameter anX = new VariableParameter();
                        anX.Unmarshal(dis);
                        this._variableParameters.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
示例#3
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._explodingEntityID.Marshal(dos);
                    this._eventID.Marshal(dos);
                    this._velocity.Marshal(dos);
                    this._locationInWorldCoordinates.Marshal(dos);
                    this._descriptor.Marshal(dos);
                    this._locationOfEntityCoordinates.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._detonationResult);
                    dos.WriteUnsignedByte((byte)this._variableParameters.Count);
                    dos.WriteUnsignedShort((ushort)this._pad);

                    for (int idx = 0; idx < this._variableParameters.Count; idx++)
                    {
                        VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
                        aVariableParameter.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
示例#4
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._entityID.Marshal(dos);
                    dos.WriteByte((byte)this._padding1);
                    dos.WriteUnsignedByte((byte)this._variableParameters.Count);
                    this._entityLinearVelocity.Marshal(dos);
                    this._entityLocation.Marshal(dos);
                    this._entityOrientation.Marshal(dos);
                    dos.WriteUnsignedInt((uint)this._entityAppearance);

                    for (int idx = 0; idx < this._variableParameters.Count; idx++)
                    {
                        VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
                        aVariableParameter.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._entityID.GetMarshalledSize();                // this._entityID
            marshalSize += 1;                                                 // this._forceId
            marshalSize += 1;                                                 // this._numberOfVariableParameters
            marshalSize += this._entityType.GetMarshalledSize();              // this._entityType
            marshalSize += this._alternativeEntityType.GetMarshalledSize();   // this._alternativeEntityType
            marshalSize += this._entityLinearVelocity.GetMarshalledSize();    // this._entityLinearVelocity
            marshalSize += this._entityLocation.GetMarshalledSize();          // this._entityLocation
            marshalSize += this._entityOrientation.GetMarshalledSize();       // this._entityOrientation
            marshalSize += 4;                                                 // this._entityAppearance
            marshalSize += this._deadReckoningParameters.GetMarshalledSize(); // this._deadReckoningParameters
            marshalSize += this._marking.GetMarshalledSize();                 // this._marking
            marshalSize += 4;                                                 // this._capabilities
            for (int idx = 0; idx < this._variableParameters.Count; idx++)
            {
                VariableParameter listElement = (VariableParameter)this._variableParameters[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<EntityStatePdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<entityID>");
                this._entityID.Reflection(sb);
                sb.AppendLine("</entityID>");
                sb.AppendLine("<forceId type=\"byte\">" + this._forceId.ToString(CultureInfo.InvariantCulture) + "</forceId>");
                sb.AppendLine("<variableParameters type=\"byte\">" + this._variableParameters.Count.ToString(CultureInfo.InvariantCulture) + "</variableParameters>");
                sb.AppendLine("<entityType>");
                this._entityType.Reflection(sb);
                sb.AppendLine("</entityType>");
                sb.AppendLine("<alternativeEntityType>");
                this._alternativeEntityType.Reflection(sb);
                sb.AppendLine("</alternativeEntityType>");
                sb.AppendLine("<entityLinearVelocity>");
                this._entityLinearVelocity.Reflection(sb);
                sb.AppendLine("</entityLinearVelocity>");
                sb.AppendLine("<entityLocation>");
                this._entityLocation.Reflection(sb);
                sb.AppendLine("</entityLocation>");
                sb.AppendLine("<entityOrientation>");
                this._entityOrientation.Reflection(sb);
                sb.AppendLine("</entityOrientation>");
                sb.AppendLine("<entityAppearance type=\"uint\">" + this._entityAppearance.ToString(CultureInfo.InvariantCulture) + "</entityAppearance>");
                sb.AppendLine("<deadReckoningParameters>");
                this._deadReckoningParameters.Reflection(sb);
                sb.AppendLine("</deadReckoningParameters>");
                sb.AppendLine("<marking>");
                this._marking.Reflection(sb);
                sb.AppendLine("</marking>");
                sb.AppendLine("<capabilities type=\"uint\">" + this._capabilities.ToString(CultureInfo.InvariantCulture) + "</capabilities>");
                for (int idx = 0; idx < this._variableParameters.Count; idx++)
                {
                    sb.AppendLine("<variableParameters" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableParameter\">");
                    VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
                    aVariableParameter.Reflection(sb);
                    sb.AppendLine("</variableParameters" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</EntityStatePdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
示例#7
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<DetonationPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<explodingEntityID>");
                this._explodingEntityID.Reflection(sb);
                sb.AppendLine("</explodingEntityID>");
                sb.AppendLine("<eventID>");
                this._eventID.Reflection(sb);
                sb.AppendLine("</eventID>");
                sb.AppendLine("<velocity>");
                this._velocity.Reflection(sb);
                sb.AppendLine("</velocity>");
                sb.AppendLine("<locationInWorldCoordinates>");
                this._locationInWorldCoordinates.Reflection(sb);
                sb.AppendLine("</locationInWorldCoordinates>");
                sb.AppendLine("<descriptor>");
                this._descriptor.Reflection(sb);
                sb.AppendLine("</descriptor>");
                sb.AppendLine("<locationOfEntityCoordinates>");
                this._locationOfEntityCoordinates.Reflection(sb);
                sb.AppendLine("</locationOfEntityCoordinates>");
                sb.AppendLine("<detonationResult type=\"byte\">" + this._detonationResult.ToString(CultureInfo.InvariantCulture) + "</detonationResult>");
                sb.AppendLine("<variableParameters type=\"byte\">" + this._variableParameters.Count.ToString(CultureInfo.InvariantCulture) + "</variableParameters>");
                sb.AppendLine("<pad type=\"ushort\">" + this._pad.ToString(CultureInfo.InvariantCulture) + "</pad>");
                for (int idx = 0; idx < this._variableParameters.Count; idx++)
                {
                    sb.AppendLine("<variableParameters" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableParameter\">");
                    VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
                    aVariableParameter.Reflection(sb);
                    sb.AppendLine("</variableParameters" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</DetonationPdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
示例#8
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._entityID.GetMarshalledSize();             // this._entityID
            marshalSize += 1;                                              // this._padding1
            marshalSize += 1;                                              // this._numberOfVariableParameters
            marshalSize += this._entityLinearVelocity.GetMarshalledSize(); // this._entityLinearVelocity
            marshalSize += this._entityLocation.GetMarshalledSize();       // this._entityLocation
            marshalSize += this._entityOrientation.GetMarshalledSize();    // this._entityOrientation
            marshalSize += 4;                                              // this._entityAppearance
            for (int idx = 0; idx < this._variableParameters.Count; idx++)
            {
                VariableParameter listElement = (VariableParameter)this._variableParameters[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
示例#9
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<EntityStateUpdatePdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<entityID>");
                this._entityID.Reflection(sb);
                sb.AppendLine("</entityID>");
                sb.AppendLine("<padding1 type=\"byte\">" + this._padding1.ToString(CultureInfo.InvariantCulture) + "</padding1>");
                sb.AppendLine("<variableParameters type=\"byte\">" + this._variableParameters.Count.ToString(CultureInfo.InvariantCulture) + "</variableParameters>");
                sb.AppendLine("<entityLinearVelocity>");
                this._entityLinearVelocity.Reflection(sb);
                sb.AppendLine("</entityLinearVelocity>");
                sb.AppendLine("<entityLocation>");
                this._entityLocation.Reflection(sb);
                sb.AppendLine("</entityLocation>");
                sb.AppendLine("<entityOrientation>");
                this._entityOrientation.Reflection(sb);
                sb.AppendLine("</entityOrientation>");
                sb.AppendLine("<entityAppearance type=\"uint\">" + this._entityAppearance.ToString(CultureInfo.InvariantCulture) + "</entityAppearance>");
                for (int idx = 0; idx < this._variableParameters.Count; idx++)
                {
                    sb.AppendLine("<variableParameters" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"VariableParameter\">");
                    VariableParameter aVariableParameter = (VariableParameter)this._variableParameters[idx];
                    aVariableParameter.Reflection(sb);
                    sb.AppendLine("</variableParameters" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</EntityStateUpdatePdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
示例#10
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._explodingEntityID.GetMarshalledSize();           // this._explodingEntityID
            marshalSize += this._eventID.GetMarshalledSize();                     // this._eventID
            marshalSize += this._velocity.GetMarshalledSize();                    // this._velocity
            marshalSize += this._locationInWorldCoordinates.GetMarshalledSize();  // this._locationInWorldCoordinates
            marshalSize += this._descriptor.GetMarshalledSize();                  // this._descriptor
            marshalSize += this._locationOfEntityCoordinates.GetMarshalledSize(); // this._locationOfEntityCoordinates
            marshalSize += 1;                                                     // this._detonationResult
            marshalSize += 1;                                                     // this._numberOfVariableParameters
            marshalSize += 2;                                                     // this._pad
            for (int idx = 0; idx < this._variableParameters.Count; idx++)
            {
                VariableParameter listElement = (VariableParameter)this._variableParameters[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
        /// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(VariableParameter obj)
        {
            bool ivarsEqual = true;

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

            if (this._recordType != obj._recordType)
            {
                ivarsEqual = false;
            }

            if (this._variableParameterFields1 != obj._variableParameterFields1)
            {
                ivarsEqual = false;
            }

            if (this._variableParameterFields2 != obj._variableParameterFields2)
            {
                ivarsEqual = false;
            }

            if (this._variableParameterFields3 != obj._variableParameterFields3)
            {
                ivarsEqual = false;
            }

            if (this._variableParameterFields4 != obj._variableParameterFields4)
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }