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); }
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(); }
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(); }
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; }