Exemple #1
0
        private void UpdateGrid(EstimatedBoard estimatedBoard)
        {
            currentBoard = estimatedBoard;
            var board = estimatedBoard.Board;

            for (int x = 0; x < board.GetLength(0); x++)
            {
                for (int y = 0; y < board.GetLength(1); y++)
                {
                    var cell = Controls[GetName(x, y)];
                    SetButtonProps(cell, board[x, y]);
                }
            }

            moveNumberTxtBox.Text = currState.ToString();
            minMaxTxtBox.Text     = estimatedBoard.Estimate.ToString();
            if (estimatedBoard.PlayerType == BoardCell.First)
            {
                totalElapsedPlayer1TxtBox.Text = estimatedBoard.Elapsed.ToString();
            }
            if (estimatedBoard.PlayerType == BoardCell.Second)
            {
                totalElapsedPlayer2TxtBox.Text = estimatedBoard.Elapsed.ToString();
            }
        }
Exemple #2
0
 public HumanComputerGame(Game computerPlayer, BoardCell humanMove)
 {
     this.computerPlayer = computerPlayer;
     this.humanMove      = humanMove;
     estimatedBoard      = new EstimatedBoard();
 }
Exemple #3
0
 public GamePlayer(string player1GameName, string player2GameName)
 {
     player1        = new PlayerWrapper(player1GameName);
     player2        = new PlayerWrapper(player2GameName);
     estimatedBoard = new EstimatedBoard();
 }