Dump/Setup game state will now save current game turn.

Needed to test cards and AI that care about how many turns it have been since the start of the game.
This commit is contained in:
Seravy
2018-02-14 16:13:44 +01:00
parent 36917c0d18
commit 22846db1a3
3 changed files with 22 additions and 5 deletions

View File

@@ -1054,13 +1054,14 @@ public class PhaseHandler implements java.io.Serializable {
// this is a hack for the setup game state mode, do not use outside of devSetupGameState code
// as it avoids calling any of the phase effects that may be necessary in a less enforced context
public final void devModeSet(final PhaseType phase0, final Player player0, boolean endCombat) {
public final void devModeSet(final PhaseType phase0, final Player player0, boolean endCombat, int cturn) {
if (phase0 != null) {
setPhase(phase0);
}
if (player0 != null) {
setPlayerTurn(player0);
}
turn = cturn;
game.fireEvent(new GameEventTurnPhase(playerTurn, phase, ""));
if (endCombat) {
@@ -1068,9 +1069,18 @@ public class PhaseHandler implements java.io.Serializable {
}
}
public final void devModeSet(final PhaseType phase0, final Player player0) {
devModeSet(phase0, player0, true);
devModeSet(phase0, player0, true, 1);
}
public final void devModeSet(final PhaseType phase0, final Player player0, int cturn) {
devModeSet(phase0, player0, true, cturn);
}
public final void devModeSet(final PhaseType phase0, final Player player0, boolean endCombat) {
devModeSet(phase0, player0, endCombat, 0);
}
public final void endTurnByEffect() {
endCombat();
extraPhases.clear();