diff options
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/Ctrl.java | 8 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 53945c7..bbdc8df 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -34,7 +34,8 @@ public abstract class Ctrl implements Disposable { STATE_CHANGE, HUD_ANSWER, - ANIMATIONS_DONE; + ANIMATIONS_DONE, + TOGGLE_REINFORCEMENT; } class Event @@ -216,6 +217,9 @@ public abstract class Ctrl implements Disposable case ANIMATIONS_DONE: animationsDone(); break; + case TOGGLE_REINFORCEMENT: + toggleReinforcement(); + break; default: RustAndDust.error(String.format("Unhandled Event Type : %s %s", evt.type, evt.data)); } @@ -323,7 +327,7 @@ public abstract class Ctrl implements Disposable state.touch(null); } - public void reinforcementHit() + private void toggleReinforcement() { if (this.stateType == StateType.SELECT) setState(StateType.REINFORCEMENT); diff --git a/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java b/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java index ef05187..2719a87 100644 --- a/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java +++ b/core/src/ch/asynk/rustanddust/game/hud/PlayerInfo.java @@ -141,7 +141,7 @@ public class PlayerInfo implements Disposable, Drawable, Animation return true; } else if (reinforcement.hit(x, y)) { - ctrl.reinforcementHit(); + ctrl.postEvent(Ctrl.EventType.TOGGLE_REINFORCEMENT); return true; } else if (unitDock.hit(x, y)) { |