Exemplo n.º 1
0
 // Check who is the player that won
 private bool CheckWhoIsTheWinner(ComputerPlayer player, Board board)
 {
     if (player.GetSign().ToString() == CallAllChecks(board))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 2
0
 // Sets the computer player in the board
 public bool SetPlayerInBoard(ComputerPlayer computerPlayer, byte x, byte y)
 {
     if (this.board[y, x] == ' ')
     {
         this.board[y, x] = computerPlayer.GetSign();
         populated++;
         return(true);
     }
     return(false);
 }
Exemplo n.º 3
0
 // Draws the HUD
 public void DrawHud()
 {
     if (this.player2 != null)
     {
         Helper.DrawTextCenter("Player 1 [" + player1.GetSign() + "]: " + this.player1.GetPoints() + "| Player 2 [" + player2.GetSign() + "]: " + this.player2.GetPoints(), ConsoleColor.Green);
     }
     else if (this.computerPlayer1 != null && this.computerPlayer2 == null)
     {
         Helper.DrawTextCenter("Player 1 [" + player1.GetSign() + "]: " + this.player1.GetPoints() + "| Computer [" + computerPlayer1.GetSign() + "]: " + this.computerPlayer1.GetPoints(), ConsoleColor.Green);
     }
     else if (this.computerPlayer1 != null && this.computerPlayer2 != null)
     {
         Helper.DrawTextCenter("Computer 1 [" + computerPlayer1.GetSign() + "]: " + this.computerPlayer1.GetPoints() + "| Computer 2 [" + computerPlayer2.GetSign() + "]: " + this.computerPlayer2.GetPoints(), ConsoleColor.Green);
     }
 }