diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-10 15:44:40 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-10 15:44:40 +0200 |
commit | 7c5f74a89f7bc45bc7a8c300b3a149b6f88ed686 (patch) | |
tree | bd1e08ea48438a701cde0a168fa297a034f33087 /core/src/ch/asynk/tankontank | |
parent | e4e1f2d8e5c4b58b4592ef637e3f150c7f2a027c (diff) | |
download | RustAndDust-7c5f74a89f7bc45bc7a8c300b3a149b6f88ed686.zip RustAndDust-7c5f74a89f7bc45bc7a8c300b3a149b6f88ed686.tar.gz |
GameState: rename enter(boolean flag) to be more excplicite, fix Rotate.enter(hasFinalMove)
Diffstat (limited to 'core/src/ch/asynk/tankontank')
5 files changed, 12 insertions, 7 deletions
diff --git a/core/src/ch/asynk/tankontank/game/GameState.java b/core/src/ch/asynk/tankontank/game/GameState.java index 428446d..23b4ffd 100644 --- a/core/src/ch/asynk/tankontank/game/GameState.java +++ b/core/src/ch/asynk/tankontank/game/GameState.java @@ -9,7 +9,7 @@ public interface GameState ANIMATION }; - public void enter(boolean normal); + public void enter(boolean flag); public void leave(); diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateAnimation.java b/core/src/ch/asynk/tankontank/game/states/GameStateAnimation.java index a40f431..820929a 100644 --- a/core/src/ch/asynk/tankontank/game/states/GameStateAnimation.java +++ b/core/src/ch/asynk/tankontank/game/states/GameStateAnimation.java @@ -3,7 +3,7 @@ package ch.asynk.tankontank.game.states; public class GameStateAnimation extends GameStateCommon { @Override - public void enter(boolean normal) + public void enter(boolean flag) { } diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateMove.java b/core/src/ch/asynk/tankontank/game/states/GameStateMove.java index 7a953e3..0c12ef1 100644 --- a/core/src/ch/asynk/tankontank/game/states/GameStateMove.java +++ b/core/src/ch/asynk/tankontank/game/states/GameStateMove.java @@ -5,11 +5,11 @@ import com.badlogic.gdx.math.GridPoint2; public class GameStateMove extends GameStateCommon { @Override - public void enter(boolean normal) + public void enter(boolean fromSelect) { map.clearPossiblePaths(); - if (normal) { + if (fromSelect) { from.set(hex); activePawn = pawn; map.buildAndShowMovesAndAssits(activePawn, from); diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java b/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java index 5fc74af..356b73b 100644 --- a/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java +++ b/core/src/ch/asynk/tankontank/game/states/GameStateRotate.java @@ -10,10 +10,15 @@ public class GameStateRotate extends GameStateCommon private Orientation o = Orientation.KEEP; @Override - public void enter(boolean normal) + public void enter(boolean hasFinalMove) { - if (!normal) + if (!hasFinalMove) { to.set(-1, -1); + if (from.x == -1) { + from.set(hex); + activePawn = pawn; + } + } rotateOnly = (to.x == -1); diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateSelect.java b/core/src/ch/asynk/tankontank/game/states/GameStateSelect.java index 28ef39b..2f15ed8 100644 --- a/core/src/ch/asynk/tankontank/game/states/GameStateSelect.java +++ b/core/src/ch/asynk/tankontank/game/states/GameStateSelect.java @@ -11,7 +11,7 @@ public class GameStateSelect extends GameStateCommon } @Override - public void enter(boolean normal) + public void enter(boolean flag) { ctrl.hud.hide(); } |