CodinGame / codingame-game-engine

CodinGame Engine
https://www.codingame.com
MIT License
113 stars 41 forks source link

Running games back to back with game runner #2

Closed jpeg729 closed 6 years ago

jpeg729 commented 6 years ago

If I try

loop {
    Properties props = new Properties();
    props.put("seed", "1234");
    GameRunner gameRunner = new GameRunner(props);
    gameRunner.addJavaPlayer(Player.class);
    gameRunner.addJavaPlayer(Player.class);
    gameRunner.start();
}

then the game doesn't run the same on the second run.

Any ideas?

jpeg729 commented 6 years ago

Among other things the list of units still alive at the end of the first game is carried over into the second game.

jpeg729 commented 6 years ago

The issue was in my referee which wasn't reinitialising everything properly on init.