示例#1
0
        private void anotherGameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Board   board = new Board();
            Game    game  = new Game(board);
            GameGui gui   = new GameGui(game, playerTwo);

            this.Close();
            gui.ShowDialog();
        }
        public void playHumanVsBest(Individual best)
        {
            Board board = new Board();
            Game  game  = new Game(board);

            best.setValue(2);
            //TreeDraw td = new TreeDraw(best);
            GameGui gui = new GameGui(game, best);

            gui.ShowDialog();
        }
示例#3
0
        private void playAgainst_Click(object sender, EventArgs e)
        {
            initializeFunctionTerminalSets();
            Board board = new Board();
            Game  game  = new Game(board);

            selectRandomMaxIndex = bestEvalSelectMethod.SelectedIndex == 0;
            Individual PlayerOne = new Individual(board, "Player One", selectRandomMaxIndex, functionList, terminalList);
            Individual PlayerTwo = new Individual(board, "Player Two", selectRandomMaxIndex, functionList, terminalList);

            PlayerOne.setValue(1);
            PlayerTwo.setValue(2);
            GameGui gui = new GameGui(game, PlayerTwo);

            this.Hide();
            gui.ShowDialog();
            this.Show();
            PlayerOne.setIsHumanPlayer(true);
            PlayerTwo.setIsHumanPlayer(true);
            PlayerOne.setBoard(board);
            PlayerTwo.setBoard(board);
        }