diff options
Diffstat (limited to 'core/src')
4 files changed, 14 insertions, 12 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Battle.java b/core/src/ch/asynk/rustanddust/game/Battle.java index 1f82bfb..84a8e78 100644 --- a/core/src/ch/asynk/rustanddust/game/Battle.java +++ b/core/src/ch/asynk/rustanddust/game/Battle.java @@ -35,5 +35,5 @@ public interface Battle public State.StateType getState(); - public String unload(); + public String unload(boolean full); } diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java index 406e8a1..56c0801 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java @@ -57,9 +57,9 @@ public abstract class BattleCommon implements Battle } @Override - public String unload() + public String unload(boolean full) { - return map.unload(getPlayer(), getOpponent()); + return map.unload(full, getPlayer(), getOpponent()); } @Override diff --git a/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java b/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java index cb90db5..ce52756 100644 --- a/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java +++ b/core/src/ch/asynk/rustanddust/game/ctrl/Solo.java @@ -42,6 +42,6 @@ public class Solo extends Ctrl private void storeState() { - game.db.storeState(gameId, battle.getPlayer().getId(), battle.getOpponent().getId(), battle.unload()); + game.db.storeState(gameId, battle.getPlayer().getId(), battle.getOpponent().getId(), battle.unload(true)); } } diff --git a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java index 5c72394..cc5f3c9 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map5Marshal.java @@ -36,20 +36,22 @@ public abstract class Map5Marshal extends Map4Orders super(game, map, hex); } - public String unload(Player player, Player opponent) + public String unload(boolean full, Player player, Player opponent) { Json json = new Json(OutputType.json); writer.getBuffer().setLength(0); json.setWriter(writer); json.writeObjectStart(); - json.writeObjectStart("map"); - unload(json); - json.writeObjectEnd(); - json.writeArrayStart("players"); - unload(json, player); - unload(json, opponent); - json.writeArrayEnd(); + if (full) { + json.writeObjectStart("map"); + unload(json); + json.writeObjectEnd(); + json.writeArrayStart("players"); + unload(json, player); + unload(json, opponent); + json.writeArrayEnd(); + } json.writeArrayStart("orders"); unload(json, orders); json.writeArrayEnd(); |