summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateCommon.java16
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java16
2 files changed, 16 insertions, 16 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateCommon.java b/core/src/ch/asynk/tankontank/game/states/StateCommon.java
index cd230ac..a5cc875 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateCommon.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateCommon.java
@@ -1,6 +1,5 @@
package ch.asynk.tankontank.game.states;
-import ch.asynk.tankontank.game.Zone;
import ch.asynk.tankontank.game.Map;
import ch.asynk.tankontank.game.Hex;
import ch.asynk.tankontank.game.Unit;
@@ -66,19 +65,4 @@ public abstract class StateCommon implements State
map.hidePossibleTargets();
map.hideMoveableUnits();
}
-
- protected boolean checkExit(Unit unit, Hex hex)
- {
- Zone exitZone = ctrl.battle.getExitZone(unit);
- if ((exitZone == null) || !exitZone.contains(hex))
- return false;
- if (map.possiblePaths.size() == 1) {
- // TODO pathCost called with applayToPawn from Board it updates Pawn.move
- int left = (unit.getMovementPoints() - map.possiblePaths.pathCost(0));
- if (left < 1)
- return false;
- }
- ctrl.setState(StateType.ESCAPE);
- return true;
- }
}
diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java
index c4078e2..009a877 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java
@@ -2,6 +2,7 @@ package ch.asynk.tankontank.game.states;
import ch.asynk.tankontank.game.Hex;
import ch.asynk.tankontank.game.Unit;
+import ch.asynk.tankontank.game.Zone;
import ch.asynk.tankontank.game.hud.ActionButtons.Buttons;
public class StateMove extends StateCommon
@@ -178,4 +179,19 @@ public class StateMove extends StateCommon
return s;
}
+
+ private boolean checkExit(Unit unit, Hex hex)
+ {
+ Zone exitZone = ctrl.battle.getExitZone(unit);
+ if ((exitZone == null) || !exitZone.contains(hex))
+ return false;
+ if (map.possiblePaths.size() == 1) {
+ // TODO pathCost called with applayToPawn from Board it updates Pawn.move
+ int left = (unit.getMovementPoints() - map.possiblePaths.pathCost(0));
+ if (left < 1)
+ return false;
+ }
+ ctrl.setState(StateType.ESCAPE);
+ return true;
+ }
}