Exemplo n.º 1
0
 public TicTacToeSqaure(TicTacToeBoard ticTacToeBoard, int myRow, int myColumn)
 {
     CurrentStatus = SquareLetter.Empty;
     this.Parent = ticTacToeBoard;
     Row = myRow;
     Column = myColumn;
 }
Exemplo n.º 2
0
 public TicTacToeGameModel(PlayerType player1Type, PlayerType player2Type)
 {
     Board         = new TicTacToeBoard(this);
     Player1       = new Player(SquareLetter.X, player1Type);
     Player2       = new Player(SquareLetter.O, player2Type);
     CurrentPlayer = Player1;
     CurrentPlayer.Play(this);
 }
Exemplo n.º 3
0
 public TicTacToeGameModel(PlayerType player1Type, PlayerType player2Type, TicTacToeBoard board, Player currentPlayer)
 {
     // this is simulation
     Board         = new TicTacToeBoard(this, board);
     CurrentPlayer = currentPlayer;
     Player1       = new Player(SquareLetter.X, player1Type);
     Player2       = new Player(SquareLetter.O, player2Type);
 }
Exemplo n.º 4
0
 public TicTacToeBoard(TicTacToeGameModel parent, TicTacToeBoard board)
 {
     Parent  = parent;
     Squares = new TicTacToeSqaure[3, 3];
     for (int i = 0; i < 3; i++)
     {
         for (int j = 0; j < 3; j++)
         {
             Squares[i, j] = new TicTacToeSqaure(this, i, j);
             Squares[i, j].CurrentStatus = board.Squares[i, j].CurrentStatus;
         }
     }
 }
Exemplo n.º 5
0
 public void Reset()
 {
     Board         = new TicTacToeBoard(this);
     CurrentPlayer = Player1;
     CurrentPlayer.Play(this);
 }