Exemplo n.º 1
0
        public bool Write(DAIIO io, bool skiplength = false)
        {
            try
            {
                if (!skiplength)
                {
                    io.WriteBits(Length, LengthBits);
                }
                io.WriteBits(PositionPrecision, 0x8);
                io.WriteInt16(PositionCompressionArray);
                if (PositionCompression == null)
                {
                    PositionCompression = new byte[PositionCompressionArray];
                }
                for (int i = 0; i < PositionCompressionArray; i++)
                {
                    io.WriteBits(PositionCompression[i], 0x8);
                }
                io.WriteBits(ImpactPrecision, 8);
                io.WriteInt32(ImpactScale);
                io.WriteInt32(NextCallbackId);
                if (MasterInfoArray == null)
                {
                    MasterInfoArray = new MasterInfo[NextCallbackId];

                    for (int xb = 0; xb < NextCallbackId; xb++)
                    {
                        MasterInfoArray[xb] = new MasterInfo();
                    }
                }
                for (int i = 0; i < NextCallbackId; i++)
                {
                    MasterInfoArray[i].Write(io);
                }
                io.WriteInt32(LastDestructionId);

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemplo n.º 2
0
 public ImpactEntityDestructionComplex Read(DAIIO io)
 {
     xLength                  = io.ReadBit2(LengthBits);
     PositionPrecision        = (byte)io.ReadBit2(0x8);
     PositionCompressionArray = io.ReadInt16();
     PositionCompression      = new byte[PositionCompressionArray];
     for (int i = 0; i < PositionCompressionArray; i++)
     {
         PositionCompression[i] = (byte)io.ReadBit2(0x8);
     }
     ImpactPrecision = (byte)io.ReadBit2(8);
     ImpactScale     = io.ReadInt32();
     NextCallbackId  = io.ReadInt32();
     MasterInfoArray = new MasterInfo[NextCallbackId];
     for (int i = 0; i < NextCallbackId; i++)
     {
         MasterInfoArray[i] = new MasterInfo().Read(io);
     }
     LastDestructionId = io.ReadInt32();
     return(this);
 }