public GameGui(Game game, Individual opponent) { InitializeComponent(); this.game = game; this.playerTwo = opponent; playerOne = new Individual(game.getBoard(), "Player One", false, null, null); playerOne.setValue(1); playerOne.setIsHumanPlayer(true); this.playerTwo.setBoard(game.getBoard()); drawTree = new DrawTree(opponent.getStrategy()); }
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); }