From 004392e5a72b39abdbd6d85d7a5602d5c236b6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 3 Feb 2016 16:19:14 +0100 Subject: Battle: add void init(Ctrl ctrl, String payload) --- core/src/ch/asynk/rustanddust/game/Battle.java | 2 ++ core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java | 9 +++++++++ 2 files changed, 11 insertions(+) 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); -- cgit v1.1-2-g2b99