コード例 #1
0
        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);
        }
コード例 #2
0
        private void StartGame(KulamiPeer peer, Board board, bool goFirst)
        {
            Teardown();

            // Set up game engine
            HumanPlayer   humanPlayer   = new HumanPlayer(Networkmanager.ClientName, GameBoardUserControl.human_move_handler);
            NetworkPlayer networkPlayer = new NetworkPlayer(peer);

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

            control.SetChat(new ChatboxUserControl(peer));

            ContentControlActions.setBaseContentControl(control);
        }
コード例 #3
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);
        }