public AIBattleGameController(Player player1, Player player2)
        {
            _player1 = player1;
            _player2 = player2;

            _game = new Game.GameCore(_player1, _player2);
        }
Esempio n. 2
0
        private void btnNewGame_Click(object sender, EventArgs e)
        {
            using (var newGameForm = new NewGame()) {
                newGameForm.Player1AI = _newGamePlayer1AIStatus;
                newGameForm.Player2AI = _newGamePlayer2AIStatus;

                if (newGameForm.ShowDialog() == DialogResult.OK) {

                    _newGamePlayer1AIStatus = newGameForm.Player1AI;
                    _newGamePlayer2AIStatus = newGameForm.Player2AI;

                    Player player1 = new Player("Player 1",
                        Player.Player1TokenColour,
                        Player.Player1HighlightColour,
                        newGameForm.Player1AI);
                    Player player2 = new Player("Player 2",
                        Player.Player2TokenColour,
                        Player.Player2HighlightColour,
                        newGameForm.Player2AI);

                    _gameController = new GameController(this, dropBoard, player1, player2);
                    dropBoard.InitializeGameState(_gameController);
                }
            }
        }
Esempio n. 3
0
        public GameController(MainForm mainForm, DropBoard dropBoard, Player player1, Player player2)
        {
            _mainForm = mainForm;
            _dropBoard = dropBoard;
            _player1 = player1;
            _player2 = player2;

            _game = new Game.GameCore(_player1, _player2);
            _game.GameStateChanged += new EventHandler(OnGameStateChanged);
        }