definable size for arena

This commit is contained in:
vaisse
2026-02-06 11:25:47 +01:00
parent e0a2c2642a
commit c278b18872
3 changed files with 16 additions and 3 deletions

View File

@@ -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);