diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-03 16:19:14 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-02-03 16:19:14 +0100 |
commit | 004392e5a72b39abdbd6d85d7a5602d5c236b6f5 (patch) | |
tree | b8c30eed1d6f5422a5cc8a4ae4b6c8ece7708f11 /core/src/ch/asynk/rustanddust | |
parent | 684b01e756384fe62f9db91dab7e77216adf1a6a (diff) | |
download | RustAndDust-004392e5a72b39abdbd6d85d7a5602d5c236b6f5.zip RustAndDust-004392e5a72b39abdbd6d85d7a5602d5c236b6f5.tar.gz |
Battle: add void init(Ctrl ctrl, String payload)
Diffstat (limited to 'core/src/ch/asynk/rustanddust')
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Battle.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Battle.java b/core/src/ch/asynk/rustanddust/game/Battle.java index e8dd65a..baa27bb 100644 --- a/core/src/ch/asynk/rustanddust/game/Battle.java +++ b/core/src/ch/asynk/rustanddust/game/Battle.java @@ -23,6 +23,8 @@ public interface Battle public void init(Ctrl ctrl, int idA, int idB); + public void init(Ctrl ctrl, String payload); + public boolean actionDone(); public boolean turnDone(); diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java index 64d04f0..d744734 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java @@ -128,6 +128,15 @@ public abstract class BattleCommon implements Battle } @Override + public void init(Ctrl ctrl, String payload) + { + ctrl.map = this.map = factory.getMap(getMapType()); + setupMap(); + map.load(payload, players); + currentPlayer = players[0]; + } + + @Override public boolean actionDone() { boolean burn = (map.unitsActivatedSize() > 0); |