Example #1
0
        byte[]            IMessage.Serialize(byte playerIntegerSize)
        {
            byte[] message = new byte[playerIntegerSize + 204];

            Helpers.InsertPlayerInteger(message, PlayerId, 0, playerIntegerSize);

            if (!(Playfield is null))
            {
                Playfield.CopyTo(message, playerIntegerSize);
            }

            message[playerIntegerSize + 200] = (byte)FloatingPiece;
            message[playerIntegerSize + 201] = XPosition;
            message[playerIntegerSize + 202] = YPosition;
            message[playerIntegerSize + 203] = Rotation;

            return(message);
        }