public override unsafe void WriteTo(ref byte *Buffer) { base.WriteTo(ref Buffer); RoomObjectID.WriteTo(ref Buffer); *((ushort *)Buffer) = (ushort)ObjectsToUpdate.Length; Buffer += TypeSizes.SHORT; foreach (ObjectFlagsUpdate obj in ObjectsToUpdate) { obj.WriteTo(ref Buffer); } }
public override unsafe void WriteTo(ref byte *Buffer) { base.WriteTo(ref Buffer); RoomObjectID.WriteTo(ref Buffer); *((ushort *)Buffer) = (ushort)RoomObjects.Length; Buffer += TypeSizes.SHORT; foreach (RoomObject obj in RoomObjects) { obj.WriteTo(ref Buffer); } }
public override int WriteTo(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; cursor += base.WriteTo(Buffer, cursor); cursor += RoomObjectID.WriteTo(Buffer, cursor); Array.Copy(BitConverter.GetBytes(Convert.ToUInt16(ObjectsToUpdate.Length)), 0, Buffer, cursor, TypeSizes.SHORT); cursor += TypeSizes.SHORT; foreach (ObjectFlagsUpdate obj in ObjectsToUpdate) { cursor += obj.WriteTo(Buffer, cursor); } return(cursor - StartIndex); }