/// <summary> /// Wymagany konstruktor /// </summary> public AlfaBeta(Game g, Form2 displayer) : base(g, displayer) { }
public Game(Alhorithms p1, Alhorithms p2, int size, int checkersRows, int treeDepth, Form2 displayer) { this.treeDisplayer = displayer; TreeDepth = treeDepth; this.size = size; board = new Checker[size * size]; //inicjalizacja planszy for (int i = 0; i < size * size; i++) { board[i] = null; } //inicjalizaje pionków for (int y = 0; y < checkersRows; y++) { for (int x = 0; x < size / 2; x++) { board[size * y + 2 * x + (y % 2)] = new Checker(0); } } for (int y = size - 1; y >= size - checkersRows; y--) { for (int x = 0; x < size / 2; x++) { board[size * y + 2 * x + (y % 2)] = new Checker(1); } } currentPlayer = 0; if (p2 == Alhorithms.Human) { players[1] = new HumanPlayer(this); } else { players[1] = new AIPlayer(this, p2, treeDisplayer); // bot here } if (p1 == Alhorithms.Human) { players[0] = new HumanPlayer(this); } else { players[0] = new AIPlayer(this, p1, treeDisplayer); //currentPlayer = 1; // bot here } }
public void optionsFormToNull() { optionsForm = null; }