예제 #1
0
        public ConnectThreeConsoleGame()
        {
            var player1Color    = Color.Red;
            var creationRequest = new GameEngineCreationRequest(columns, rows, connectionsToWin, player1Color);

            _gameEngine = new GameEngine(creationRequest);
        }
예제 #2
0
 public GameEngine(GameEngineCreationRequest creationRequest)
 {
     GameBoard = new GameBoard(creationRequest.NumberOfColumns, creationRequest.NumberOfColumns);
     Status    = GameStatus.GameInProgress;
     _numberOfConnectionsToWin = creationRequest.NumberOfGamePiecesToConnect;
     IsPlayer1sTurn            = creationRequest.Player1GoesFirst;
     Player1 = new Player(creationRequest.Player1Color);
     if (creationRequest.Player1Color == Color.Red)
     {
         Player2 = new Player(Color.Yellow);
     }
     else
     {
         Player2 = new Player(Color.Red);
     }
 }