示例#1
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<EntityDamageStatusPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<damagedEntityID>");
                this._damagedEntityID.Reflection(sb);
                sb.AppendLine("</damagedEntityID>");
                sb.AppendLine("<padding1 type=\"ushort\">" + this._padding1.ToString(CultureInfo.InvariantCulture) + "</padding1>");
                sb.AppendLine("<padding2 type=\"ushort\">" + this._padding2.ToString(CultureInfo.InvariantCulture) + "</padding2>");
                sb.AppendLine("<damageDescriptionRecords type=\"ushort\">" + this._damageDescriptionRecords.Count.ToString(CultureInfo.InvariantCulture) + "</damageDescriptionRecords>");
                for (int idx = 0; idx < this._damageDescriptionRecords.Count; idx++)
                {
                    sb.AppendLine("<damageDescriptionRecords" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"DirectedEnergyDamage\">");
                    DirectedEnergyDamage aDirectedEnergyDamage = (DirectedEnergyDamage)this._damageDescriptionRecords[idx];
                    aDirectedEnergyDamage.Reflection(sb);
                    sb.AppendLine("</damageDescriptionRecords" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</EntityDamageStatusPdu>");
            }
            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._damagedEntityID.Unmarshal(dis);
                    this._padding1 = dis.ReadUnsignedShort();
                    this._padding2 = dis.ReadUnsignedShort();
                    this._numberOfDamageDescription = dis.ReadUnsignedShort();
                    for (int idx = 0; idx < this.NumberOfDamageDescription; idx++)
                    {
                        DirectedEnergyDamage anX = new DirectedEnergyDamage();
                        anX.Unmarshal(dis);
                        this._damageDescriptionRecords.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._damagedEntityID.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._padding1);
                    dos.WriteUnsignedShort((ushort)this._padding2);
                    dos.WriteUnsignedShort((ushort)this._damageDescriptionRecords.Count);

                    for (int idx = 0; idx < this._damageDescriptionRecords.Count; idx++)
                    {
                        DirectedEnergyDamage aDirectedEnergyDamage = (DirectedEnergyDamage)this._damageDescriptionRecords[idx];
                        aDirectedEnergyDamage.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
示例#4
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._damagedEntityID.GetMarshalledSize(); // this._damagedEntityID
            marshalSize += 2;                                         // this._padding1
            marshalSize += 2;                                         // this._padding2
            marshalSize += 2;                                         // this._numberOfDamageDescription
            for (int idx = 0; idx < this._damageDescriptionRecords.Count; idx++)
            {
                DirectedEnergyDamage listElement = (DirectedEnergyDamage)this._damageDescriptionRecords[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(DirectedEnergyDamage obj)
        {
            bool ivarsEqual = true;

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

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

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

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

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

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

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

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

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

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

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

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

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

            return(ivarsEqual);
        }
        /// <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(DirectedEnergyDamage obj)
        {
            bool ivarsEqual = true;

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

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

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

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

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

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

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

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

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

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

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

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

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

            return ivarsEqual;
        }