definable size for arena
This commit is contained in:
@@ -12,11 +12,13 @@ public class Arena {
|
||||
|
||||
private List<AbstractGamePlayer> bots = new ArrayList<>();
|
||||
private FileWriter csvWriter;
|
||||
private int board_size;
|
||||
|
||||
public Arena() {
|
||||
public Arena(int size) {
|
||||
try {
|
||||
csvWriter = new FileWriter("arena_results.csv");
|
||||
csvWriter.append("Bot 1, Bot 2, Winner\n");
|
||||
this.board_size = size;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -51,7 +53,7 @@ public class Arena {
|
||||
}
|
||||
|
||||
private Result playMatch(AbstractGamePlayer bot1, AbstractGamePlayer bot2) {
|
||||
IBoard board = new HexBoard(11);
|
||||
IBoard board = new HexBoard(this.board_size);
|
||||
EnumMap<Player, AbstractGamePlayer> players = new EnumMap<>(Player.class);
|
||||
players.put(Player.PLAYER1, bot1);
|
||||
players.put(Player.PLAYER2, bot2);
|
||||
|
||||
Reference in New Issue
Block a user