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

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

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

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

            if (ivarsEqual)
            {
                for (int idx = 0; idx < this._standardVariables.Count; idx++)
                {
                    if (!this._standardVariables[idx].Equals(obj._standardVariables[idx]))
                    {
                        ivarsEqual = false;
                    }
                }
            }

            return(ivarsEqual);
        }
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._munitionType.GetMarshalledSize();            // this._munitionType
            marshalSize += this._shotStartTime.GetMarshalledSize();           // this._shotStartTime
            marshalSize += 4;                                                 // this._commulativeShotTime
            marshalSize += this._ApertureEmitterLocation.GetMarshalledSize(); // this._ApertureEmitterLocation
            marshalSize += 4;                                                 // this._apertureDiameter
            marshalSize += 4;                                                 // this._wavelength
            marshalSize += 4;                                                 // this._peakIrradiance
            marshalSize += 4;                                                 // this._pulseRepetitionFrequency
            marshalSize += 4;                                                 // this._pulseWidth
            marshalSize += 4;                                                 // this._flags
            marshalSize += 1;                                                 // this._pulseShape
            marshalSize += 1;                                                 // this._padding1
            marshalSize += 4;                                                 // this._padding2
            marshalSize += 2;                                                 // this._padding3
            marshalSize += 2;                                                 // this._numberOfDERecords
            for (int idx = 0; idx < this._dERecords.Count; idx++)
            {
                StandardVariableSpecification listElement = (StandardVariableSpecification)this._dERecords[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<DirectedEnergyFirePdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<munitionType>");
                this._munitionType.Reflection(sb);
                sb.AppendLine("</munitionType>");
                sb.AppendLine("<shotStartTime>");
                this._shotStartTime.Reflection(sb);
                sb.AppendLine("</shotStartTime>");
                sb.AppendLine("<commulativeShotTime type=\"float\">" + this._commulativeShotTime.ToString(CultureInfo.InvariantCulture) + "</commulativeShotTime>");
                sb.AppendLine("<ApertureEmitterLocation>");
                this._ApertureEmitterLocation.Reflection(sb);
                sb.AppendLine("</ApertureEmitterLocation>");
                sb.AppendLine("<apertureDiameter type=\"float\">" + this._apertureDiameter.ToString(CultureInfo.InvariantCulture) + "</apertureDiameter>");
                sb.AppendLine("<wavelength type=\"float\">" + this._wavelength.ToString(CultureInfo.InvariantCulture) + "</wavelength>");
                sb.AppendLine("<peakIrradiance type=\"float\">" + this._peakIrradiance.ToString(CultureInfo.InvariantCulture) + "</peakIrradiance>");
                sb.AppendLine("<pulseRepetitionFrequency type=\"float\">" + this._pulseRepetitionFrequency.ToString(CultureInfo.InvariantCulture) + "</pulseRepetitionFrequency>");
                sb.AppendLine("<pulseWidth type=\"int\">" + this._pulseWidth.ToString(CultureInfo.InvariantCulture) + "</pulseWidth>");
                sb.AppendLine("<flags type=\"int\">" + this._flags.ToString(CultureInfo.InvariantCulture) + "</flags>");
                sb.AppendLine("<pulseShape type=\"byte\">" + this._pulseShape.ToString(CultureInfo.InvariantCulture) + "</pulseShape>");
                sb.AppendLine("<padding1 type=\"byte\">" + this._padding1.ToString(CultureInfo.InvariantCulture) + "</padding1>");
                sb.AppendLine("<padding2 type=\"uint\">" + this._padding2.ToString(CultureInfo.InvariantCulture) + "</padding2>");
                sb.AppendLine("<padding3 type=\"ushort\">" + this._padding3.ToString(CultureInfo.InvariantCulture) + "</padding3>");
                sb.AppendLine("<dERecords type=\"ushort\">" + this._dERecords.Count.ToString(CultureInfo.InvariantCulture) + "</dERecords>");
                for (int idx = 0; idx < this._dERecords.Count; idx++)
                {
                    sb.AppendLine("<dERecords" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"StandardVariableSpecification\">");
                    StandardVariableSpecification aStandardVariableSpecification = (StandardVariableSpecification)this._dERecords[idx];
                    aStandardVariableSpecification.Reflection(sb);
                    sb.AppendLine("</dERecords" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</DirectedEnergyFirePdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._munitionType.Unmarshal(dis);
                    this._shotStartTime.Unmarshal(dis);
                    this._commulativeShotTime = dis.ReadFloat();
                    this._ApertureEmitterLocation.Unmarshal(dis);
                    this._apertureDiameter         = dis.ReadFloat();
                    this._wavelength               = dis.ReadFloat();
                    this._peakIrradiance           = dis.ReadFloat();
                    this._pulseRepetitionFrequency = dis.ReadFloat();
                    this._pulseWidth               = dis.ReadInt();
                    this._flags             = dis.ReadInt();
                    this._pulseShape        = dis.ReadByte();
                    this._padding1          = dis.ReadUnsignedByte();
                    this._padding2          = dis.ReadUnsignedInt();
                    this._padding3          = dis.ReadUnsignedShort();
                    this._numberOfDERecords = dis.ReadUnsignedShort();
                    for (int idx = 0; idx < this.NumberOfDERecords; idx++)
                    {
                        StandardVariableSpecification anX = new StandardVariableSpecification();
                        anX.Unmarshal(dis);
                        this._dERecords.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._munitionType.Marshal(dos);
                    this._shotStartTime.Marshal(dos);
                    dos.WriteFloat((float)this._commulativeShotTime);
                    this._ApertureEmitterLocation.Marshal(dos);
                    dos.WriteFloat((float)this._apertureDiameter);
                    dos.WriteFloat((float)this._wavelength);
                    dos.WriteFloat((float)this._peakIrradiance);
                    dos.WriteFloat((float)this._pulseRepetitionFrequency);
                    dos.WriteInt((int)this._pulseWidth);
                    dos.WriteInt((int)this._flags);
                    dos.WriteByte((byte)this._pulseShape);
                    dos.WriteUnsignedByte((byte)this._padding1);
                    dos.WriteUnsignedInt((uint)this._padding2);
                    dos.WriteUnsignedShort((ushort)this._padding3);
                    dos.WriteUnsignedShort((ushort)this._dERecords.Count);

                    for (int idx = 0; idx < this._dERecords.Count; idx++)
                    {
                        StandardVariableSpecification aStandardVariableSpecification = (StandardVariableSpecification)this._dERecords[idx];
                        aStandardVariableSpecification.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }