diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-09 08:28:55 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-09 08:28:55 +0100 |
commit | 4dc8f0f982408ad71c0ad94e7f84fcfd1edf3ce7 (patch) | |
tree | f225356998a0833fe5fdf8656c11a458fed6932f | |
parent | 8a8e535403a00cb5cab29a19b23c6ead9bcf90b2 (diff) | |
download | RustAndDust-4dc8f0f982408ad71c0ad94e7f84fcfd1edf3ce7.zip RustAndDust-4dc8f0f982408ad71c0ad94e7f84fcfd1edf3ce7.tar.gz |
Battle: add actionDone()
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Battle.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Ctrl.java | 5 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java | 10 |
3 files changed, 13 insertions, 4 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Battle.java b/core/src/ch/asynk/rustanddust/game/Battle.java index c6e4983..86d95a7 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 Player getVictor(); + public boolean actionDone(); + public boolean turnDone(); public boolean isDeploymentDone(); diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 23116db..e80890c 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -133,11 +133,8 @@ public class Ctrl implements Disposable StateType nextState = this.state.execute(); if (nextState == StateType.DONE) { - map.actionDone(); - if (map.unitsActivatedSize() > 0) { - RustAndDust.debug("Ctrl", "burn down 1AP"); + if (battle.actionDone()) { hud.notify("1 Action Point burnt", 0.6f, Position.BOTTOM_CENTER, false); - battle.getPlayer().burnDownOneAp(); hud.update(); } if (battle.getPlayer().apExhausted()) diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java index 13edd7c..0cc2189 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java @@ -71,6 +71,16 @@ public abstract class BattleCommon implements Battle } @Override + public boolean actionDone() + { + boolean burn = (map.unitsActivatedSize() > 0); + if (burn) + currentPlayer.burnDownOneAp(); + map.actionDone(); + return burn; + } + + @Override public boolean turnDone() { map.turnDone(); |