Пример #1
0
 public void DisplayNewGrid(Morpion3Dimension.Model.Grid grid)
 {
     if (DisplayNewGridEvent != null)
     {
         DisplayNewGridEvent(grid);
     }
 }
Пример #2
0
    private void HandleMessage(byte[] data)
    {
        MessageType type       = Message.GetMessageType(data);
        string      DataAsText = Encoding.UTF8.GetString(data);

        Debug.Log($"received from server : {DataAsText}");

        switch (type)
        {
        case MessageType.move:
            graphics.AskMove();
            Debug.Log("asked a move");
            break;

        case MessageType.gameOver:
            GameOverMessage gameOverMessage = new GameOverMessage(data);
            graphics.DisplayGameOver(gameOverMessage);
            break;

        case MessageType.grid:
            var grid = new Morpion3Dimension.Model.Grid(data);
            graphics.DisplayNewGrid(grid);
            break;

        default:
            Debug.Log(Encoding.UTF8.GetString(data));
            break;
        }
    }
Пример #3
0
    public void OnDisplayNewGridEvent(Morpion3Dimension.Model.Grid grid)
    {
        //Debug.Log($"trying to display grid at {x}{y}{z}");
        Square square = (Square)grid[x, y, z];
        Symbol symbol = square.symbol;

        if (symbol == Symbol.empty)
        {
            changeColor.DrawBlank();
        }
        if (symbol == Symbol.circle)
        {
            changeColor.DrawCircle();
        }
        if (symbol == Symbol.cross)
        {
            changeColor.DrawCross();
        }

        //Debug.Log($"I (Cube {x}, {y}, {z}) am displaying a new grid");
    }
 public void DisplayNewGrid(Morpion3Dimension.Model.Grid grid)
 {
 }