diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java | 4 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java | 6 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/util/Marshal.java | 1 |
3 files changed, 10 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java index 20f6a25..255aa6c 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java @@ -102,7 +102,9 @@ public abstract class BattleCommon implements Battle public void load(Marshal.Mode mode, JsonValue value) { - if (mode == Marshal.Mode.PLAYERS) { + if (mode == Marshal.Mode.PLAYER) { + map.loadPlayerAP(value, 0, currentPlayer); + } else if (mode == Marshal.Mode.PLAYERS) { map.loadPlayers(value, players); this.currentPlayer = players[0]; } else { diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index d1d7ccc..dc7554f 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -280,6 +280,12 @@ public abstract class Map5Marshal extends Map4Orders implements Marshal Unit.blockId = false; } + public void loadPlayerAP(JsonValue v, int idx, Player player) + { + JsonValue a = v.get("players").get(idx).get("v"); + player.setTurn(a.getInt(0), a.getInt(1), a.getInt(2)); + } + private Player loadPlayer(JsonValue v) { Player p = new Player(Army.valueOf(v.getString("a"))); diff --git a/core/src/ch/asynk/rustanddust/util/Marshal.java b/core/src/ch/asynk/rustanddust/util/Marshal.java index f805fa1..f2e1b47 100644 --- a/core/src/ch/asynk/rustanddust/util/Marshal.java +++ b/core/src/ch/asynk/rustanddust/util/Marshal.java @@ -10,6 +10,7 @@ public interface Marshal PLAYERS, MAP, ORDERS, + PLAYER, } public void unload(Mode mode, Json json); |