Esempio n. 1
0
 public TicTacToeSqaure(TicTacToeBoard ticTacToeBoard, int myRow, int myColumn)
 {
     CurrentStatus = SquareLetter.Empty;
     this.Parent = ticTacToeBoard;
     Row = myRow;
     Column = myColumn;
 }
Esempio 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);
 }
Esempio 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);
 }
Esempio 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;
         }
     }
 }
Esempio n. 5
0
 public void Reset()
 {
     Board         = new TicTacToeBoard(this);
     CurrentPlayer = Player1;
     CurrentPlayer.Play(this);
 }