Example #1
0
    public void SendInitialBoard(Board board)
    {
        var message = new SocketMessage(SocketMessage.Code.SendInitialBoard);
        var items   = board.Items;

        for (int i = 0; i < items.Count; ++i)
        {
            var item = items[i];
            message.AddByte((byte)item.Index.I);
            message.AddByte((byte)item.Index.J);
            message.AddByte((byte)(item.Direction == BoardItemDirection.Horizontal ? 1 : 0));
            message.AddByte((byte)item.Size);
        }

        SocketManager.Main.Send(message);

        if (OnSendInitialBoard != null)
        {
            OnSendInitialBoard();
        }
    }