diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-29 06:52:53 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-29 06:52:53 +0100 |
commit | 98a329b9e709b77a861f532d4ba694dab6093efd (patch) | |
tree | 3b92c7afa31ffd38b59677891aeafdca0f47c6e3 /core/src/ch/asynk/rustanddust/game | |
parent | 55b74b3568d122e2366ba438dae4108f1484ec3a (diff) | |
download | RustAndDust-98a329b9e709b77a861f532d4ba694dab6093efd.zip RustAndDust-98a329b9e709b77a861f532d4ba694dab6093efd.tar.gz |
Battle,Map5Marshal: add boolean full to unload(...)
Diffstat (limited to 'core/src/ch/asynk/rustanddust/game')
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(); |