summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-19 12:24:25 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-19 12:24:25 +0100
commit0b57bfb1840d0020634c413ef6d4a0f2d88ced99 (patch)
tree24d29191dbe5c6b3521e5db481e87e3826a0dc4c /core/src/ch/asynk/tankontank/game
parent51f534e24dc3406851693990ad2dc748ae642816 (diff)
downloadRustAndDust-0b57bfb1840d0020634c413ef6d4a0f2d88ced99.zip
RustAndDust-0b57bfb1840d0020634c413ef6d4a0f2d88ced99.tar.gz
PossiblePaths: add boolean canExit(Orientation o)
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java6
1 files changed, 1 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java
index 7f2767b..b388862 100644
--- a/core/src/ch/asynk/tankontank/game/states/StateMove.java
+++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java
@@ -184,12 +184,8 @@ public class StateMove extends StateCommon
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)
+ if (!map.possiblePaths.canExit(exitZone.orientation))
return false;
- }
ctrl.setState(StateType.ESCAPE);
return true;
}