From d62eccc5d9f72a851378c4bce96602bb6deed30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 10 Oct 2014 15:32:19 +0200 Subject: get rid of GameStateDirection --- core/src/ch/asynk/tankontank/game/GameCtrl.java | 6 --- core/src/ch/asynk/tankontank/game/GameState.java | 1 - .../tankontank/game/states/GameStateDirection.java | 46 ---------------------- 3 files changed, 53 deletions(-) delete mode 100644 core/src/ch/asynk/tankontank/game/states/GameStateDirection.java diff --git a/core/src/ch/asynk/tankontank/game/GameCtrl.java b/core/src/ch/asynk/tankontank/game/GameCtrl.java index 4d4c4f4..bcec97f 100644 --- a/core/src/ch/asynk/tankontank/game/GameCtrl.java +++ b/core/src/ch/asynk/tankontank/game/GameCtrl.java @@ -6,7 +6,6 @@ import ch.asynk.tankontank.TankOnTank; import ch.asynk.tankontank.game.states.GameStateCommon; import ch.asynk.tankontank.game.states.GameStateSelect; import ch.asynk.tankontank.game.states.GameStateMove; -import ch.asynk.tankontank.game.states.GameStateDirection; import ch.asynk.tankontank.game.states.GameStateRotate; import ch.asynk.tankontank.game.states.GameStateAnimation; @@ -40,7 +39,6 @@ public class GameCtrl implements Disposable private GameState selectState; private GameState pathState; - private GameState directionState; private GameState rotateState; private GameState animationState; @@ -60,7 +58,6 @@ public class GameCtrl implements Disposable this.selectState = new GameStateSelect(this, map); this.pathState = new GameStateMove(); - this.directionState = new GameStateDirection(); this.rotateState = new GameStateRotate(); this.animationState = new GameStateAnimation(); @@ -118,9 +115,6 @@ public class GameCtrl implements Disposable case MOVE: this.state = pathState; break; - case DIRECTION: - this.state = directionState; - break; case ROTATE: this.state = rotateState; break; diff --git a/core/src/ch/asynk/tankontank/game/GameState.java b/core/src/ch/asynk/tankontank/game/GameState.java index 70568bd..428446d 100644 --- a/core/src/ch/asynk/tankontank/game/GameState.java +++ b/core/src/ch/asynk/tankontank/game/GameState.java @@ -5,7 +5,6 @@ public interface GameState enum State { SELECT, MOVE, - DIRECTION, ROTATE, ANIMATION }; diff --git a/core/src/ch/asynk/tankontank/game/states/GameStateDirection.java b/core/src/ch/asynk/tankontank/game/states/GameStateDirection.java deleted file mode 100644 index f1b2bb5..0000000 --- a/core/src/ch/asynk/tankontank/game/states/GameStateDirection.java +++ /dev/null @@ -1,46 +0,0 @@ -package ch.asynk.tankontank.game.states; - -import ch.asynk.tankontank.engine.Orientation; - -public class GameStateDirection extends GameStateCommon -{ - @Override - public void enter(boolean reset) - { - map.showFinalPath(to, true); - } - - @Override - public void leave() - { - map.showMoveAssists(false); - map.showFinalPath(to, false); - if (to.x != -1) unselectHex(to); - if (from.x != -1) unselectHex(from); - to.set(-1, -1); - from.set(-1, -1); - } - - @Override - public void touchDown() - { - } - - @Override - public void touchUp() - { - Orientation o = Orientation.fromAdj(to.x, to.y, downHex.x, downHex.y); - - if (o != Orientation.KEEP) { - map.movePawn(pawn, o); - ctrl.hud.hide(); - ctrl.setState(State.ANIMATION); - } - } - - @Override - public void abort() - { - super.abort(); - } -} -- cgit v1.1-2-g2b99