Esempio n. 1
0
        public int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            ServerID = BitConverter.ToInt16(Buffer, cursor);
            cursor  += TypeSizes.SHORT;

            MiddleTexture = BitConverter.ToUInt16(Buffer, cursor);
            cursor       += TypeSizes.SHORT;

            UpperTexture = BitConverter.ToUInt16(Buffer, cursor);
            cursor      += TypeSizes.SHORT;

            LowerTexture = BitConverter.ToUInt16(Buffer, cursor);
            cursor      += TypeSizes.SHORT;

            Flags   = new RooSideDefFlags(BitConverter.ToUInt32(Buffer, cursor));
            cursor += TypeSizes.INT;

            Speed = Buffer[cursor];
            cursor++;

            // create animation if any
            CreateAnimation();

            return(cursor - StartIndex);
        }
Esempio n. 2
0
        public unsafe void ReadFrom(ref byte *Buffer)
        {
            ServerID = *((short *)Buffer);
            Buffer  += TypeSizes.SHORT;

            MiddleTexture = *((ushort *)Buffer);
            Buffer       += TypeSizes.SHORT;

            UpperTexture = *((ushort *)Buffer);
            Buffer      += TypeSizes.SHORT;

            LowerTexture = *((ushort *)Buffer);
            Buffer      += TypeSizes.SHORT;

            Flags   = new RooSideDefFlags(*((uint *)Buffer));
            Buffer += TypeSizes.INT;

            Speed = Buffer[0];
            Buffer++;

            // create animation if any
            CreateAnimation();
        }
Esempio n. 3
0
        public unsafe void ReadFrom(ref byte* Buffer)
        {
            ServerID = *((short*)Buffer);
            Buffer += TypeSizes.SHORT;

            MiddleTexture = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            UpperTexture = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            LowerTexture = *((ushort*)Buffer);
            Buffer += TypeSizes.SHORT;

            Flags = new RooSideDefFlags(*((uint*)Buffer));
            Buffer += TypeSizes.INT;

            Speed = Buffer[0];
            Buffer++;

            // create animation if any
            CreateAnimation();
        }
Esempio n. 4
0
        public int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            ServerID = BitConverter.ToInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            MiddleTexture = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            UpperTexture = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            LowerTexture = BitConverter.ToUInt16(Buffer, cursor);
            cursor += TypeSizes.SHORT;

            Flags = new RooSideDefFlags(BitConverter.ToUInt32(Buffer, cursor));
            cursor += TypeSizes.INT;

            Speed = Buffer[cursor];
            cursor++;

            // create animation if any
            CreateAnimation();

            return cursor - StartIndex;
        }