- Clean up some code ugliness and fix a meaningless "unknown key: turn" error message in GameState.

This commit is contained in:
Agetian
2018-03-17 17:15:25 +03:00
parent fb3e5a68aa
commit e23f807e63

View File

@@ -82,7 +82,7 @@ public abstract class GameState {
private String precastHuman = null; private String precastHuman = null;
private String precastAI = null; private String precastAI = null;
private int turn; private int turn = 1;
// Targeting for precast spells in a game state (mostly used by Puzzle Mode game states) // Targeting for precast spells in a game state (mostly used by Puzzle Mode game states)
private final int TARGET_NONE = -1; // untargeted spell (e.g. Joraga Invocation) private final int TARGET_NONE = -1; // untargeted spell (e.g. Joraga Invocation)
@@ -398,10 +398,9 @@ public abstract class GameState {
if (categoryName.equals("turn")) { if (categoryName.equals("turn")) {
turn = Integer.parseInt(categoryValue); turn = Integer.parseInt(categoryValue);
} else {
turn = 1;
} }
if (categoryName.endsWith("life")) {
else if (categoryName.endsWith("life")) {
if (isHuman) if (isHuman)
humanLife = Integer.parseInt(categoryValue); humanLife = Integer.parseInt(categoryValue);
else else