Ejemplo n.º 1
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._minefieldID.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._minefieldSequence);
                    dos.WriteUnsignedByte((byte)this._forceID);
                    dos.WriteUnsignedByte((byte)this._perimeterPoints.Count);
                    this._minefieldType.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._mineType.Count);
                    this._minefieldLocation.Marshal(dos);
                    this._minefieldOrientation.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._appearance);
                    dos.WriteUnsignedShort((ushort)this._protocolMode);

                    for (int idx = 0; idx < this._perimeterPoints.Count; idx++)
                    {
                        Point aPoint = (Point)this._perimeterPoints[idx];
                        aPoint.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._mineType.Count; idx++)
                    {
                        EntityType aEntityType = (EntityType)this._mineType[idx];
                        aEntityType.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
                    if (PduBase.TraceExceptions)
                    {
                        Trace.WriteLine(e);
                        Trace.Flush();
                    }

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._aggregateID.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._forceID);
                    dos.WriteUnsignedByte((byte)this._aggregateState);
                    this._aggregateType.Marshal(dos);
                    dos.WriteUnsignedInt((uint)this._formation);
                    this._aggregateMarking.Marshal(dos);
                    this._dimensions.Marshal(dos);
                    this._orientation.Marshal(dos);
                    this._centerOfMass.Marshal(dos);
                    this._velocity.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._aggregateIDList.Count);
                    dos.WriteUnsignedShort((ushort)this._entityIDList.Count);
                    dos.WriteUnsignedShort((ushort)this._silentAggregateSystemList.Count);
                    dos.WriteUnsignedShort((ushort)this._silentEntitySystemList.Count);

                    for (int idx = 0; idx < this._aggregateIDList.Count; idx++)
                    {
                        AggregateID aAggregateID = (AggregateID)this._aggregateIDList[idx];
                        aAggregateID.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._entityIDList.Count; idx++)
                    {
                        EntityID aEntityID = (EntityID)this._entityIDList[idx];
                        aEntityID.Marshal(dos);
                    }

                    dos.WriteUnsignedByte((byte)this._pad2);

                    for (int idx = 0; idx < this._silentAggregateSystemList.Count; idx++)
                    {
                        EntityType aEntityType = (EntityType)this._silentAggregateSystemList[idx];
                        aEntityType.Marshal(dos);
                    }

                    for (int idx = 0; idx < this._silentEntitySystemList.Count; idx++)
                    {
                        EntityType aEntityType = (EntityType)this._silentEntitySystemList[idx];
                        aEntityType.Marshal(dos);
                    }

                    dos.WriteUnsignedInt((uint)this._variableDatumList.Count);

                    for (int idx = 0; idx < this._variableDatumList.Count; idx++)
                    {
                        VariableDatum aVariableDatum = (VariableDatum)this._variableDatumList[idx];
                        aVariableDatum.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
                    if (PduBase.TraceExceptions)
                    {
                        Trace.WriteLine(e);
                        Trace.Flush();
                    }

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }