diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-15 23:59:27 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-15 23:59:27 +0100 |
commit | f150e03ee334fd403f31eb9f94de71b375224f9a (patch) | |
tree | 3512a1429656db80b6750f618072e478bdda9103 /core/src/ch/asynk/tankontank | |
parent | f61bd765a4d85c759304189adfc05be262c048f2 (diff) | |
download | RustAndDust-f150e03ee334fd403f31eb9f94de71b375224f9a.zip RustAndDust-f150e03ee334fd403f31eb9f94de71b375224f9a.tar.gz |
Ctrl: replace toggleState(StateType, StateType) with reinforcementHit()
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Ctrl.java | 14 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java index 203bed9..acc92dd 100644 --- a/core/src/ch/asynk/tankontank/game/Ctrl.java +++ b/core/src/ch/asynk/tankontank/game/Ctrl.java @@ -172,15 +172,13 @@ public class Ctrl implements Disposable this.state.touchUp(); } - public void toggleState(StateType stateA, StateType stateB) + + public void reinforcementHit() { - if (this.stateType == stateA) { - setState(stateB); - } else if (this.stateType == stateB) { - setState(stateA); - } else { - TankOnTank.debug("Ctrl", "wrong call to toggleState()"); - } + if (this.stateType == StateType.SELECT) + setState(StateType.REINFORCEMENT); + else if (this.stateType == StateType.REINFORCEMENT) + setState(StateType.SELECT); } public void setState(StateType nextState) diff --git a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java index 5b7b54e..ffc76c6 100644 --- a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java +++ b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java @@ -141,7 +141,7 @@ public class PlayerInfo implements Disposable, Drawable } else if (hit == reinforcement) { if (reinforcement.hit(x, y)) - ctrl.toggleState(StateType.REINFORCEMENT, StateType.SELECT); + ctrl.reinforcementHit(); } else if (hit == unitDock) { if (unitDock.hit(x, y)) |