private void Play_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            // Set up game engine
            HumanPlayer humanPlayerRed   = new HumanPlayer(PlayerOneNamePrompt.Text, GameBoardUserControl.human_move_handler);
            HumanPlayer humanPlayerBlack = new HumanPlayer(PlayerTwoNamePrompt.Text, GameBoardUserControl.human_move_handler);

            Board board = BoardSetup.Random();

            GameBoardUserControl control = new GameBoardUserControl(
                board,
                humanPlayerRed,
                humanPlayerBlack,
                PieceType.Red
                );

            ContentControlActions.setBaseContentControl(control);
        }
Example #2
0
        private void startGame()
        {
            ContentControlActions.FadeOut();

            // Set up game engine
            HumanPlayer humanPlayer = new HumanPlayer(GameBoardUserControl.human_move_handler);
            Player      AiPlayer    = gameModeIsHard ? (Player) new HardAiPlayer() : new EasyAiPlayer();

            Board board = BoardSetup.Random();

            GameBoardUserControl control = new GameBoardUserControl(
                board,
                humanPlayer,
                AiPlayer,
                playerGoesFirst ? PieceType.Red : PieceType.Black
                );

            ContentControlActions.setBaseContentControl(control);
        }