diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-13 17:08:47 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-13 17:08:47 +0100 |
commit | e6fcc7c9f292dfe9abeddcd773a9921c765b577e (patch) | |
tree | 3ee1eafbc0f54899e7b7f3b708a6f9c819bbe73e /core | |
parent | a05e1e540e1c7136beaae989ce50bdfe7663eb58 (diff) | |
download | RustAndDust-e6fcc7c9f292dfe9abeddcd773a9921c765b577e.zip RustAndDust-e6fcc7c9f292dfe9abeddcd773a9921c765b577e.tar.gz |
Map: do not set possiblePaths.orientation, states take care of that
Diffstat (limited to 'core')
4 files changed, 5 insertions, 5 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 882d8f5..14c68d8 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -312,9 +312,8 @@ public abstract class Map extends Board addAnimation(seq); } - public int moveUnit(Unit unit, Orientation o) + public int moveUnit(Unit unit) { - possiblePaths.orientation = o; possiblePaths.applyToPawn(0); movePawn(unit, possiblePaths, notifyDoneAnimation(unit), objectives); diff --git a/core/src/ch/asynk/tankontank/game/states/StateBreak.java b/core/src/ch/asynk/tankontank/game/states/StateBreak.java index 034bb0b..2274e82 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateBreak.java +++ b/core/src/ch/asynk/tankontank/game/states/StateBreak.java @@ -81,7 +81,7 @@ public class StateBreak extends StateCommon map.possiblePaths.init(activeUnit); if (map.possiblePaths.build(to) == 1) { map.possiblePaths.orientation = o; - map.moveUnit(activeUnit, o); + map.moveUnit(activeUnit); ctrl.setAnimationCount(1); ctrl.setAfterAnimationState(StateType.DONE); } else diff --git a/core/src/ch/asynk/tankontank/game/states/StateEscape.java b/core/src/ch/asynk/tankontank/game/states/StateEscape.java index 8996d6b..cc31007 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateEscape.java +++ b/core/src/ch/asynk/tankontank/game/states/StateEscape.java @@ -53,6 +53,7 @@ public class StateEscape extends StateCommon map.possiblePaths.setExit(exitZone.orientation); else map.possiblePaths.build(map.getAdjTileAt(unit.getTile(), exitZone.orientation)); + map.possiblePaths.orientation = exitZone.orientation; unit.hideMoveable(); map.hidePossibleMoves(); @@ -61,7 +62,7 @@ public class StateEscape extends StateCommon map.leaveBoard(unit); ctrl.player.unitEscape(unit); - if (map.moveUnit(activeUnit, exitZone.orientation) > 0) + if (map.moveUnit(activeUnit) > 0) return StateType.MOVE; return StateType.DONE; } diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java index 45a02c2..8cf9689 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java +++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java @@ -71,7 +71,7 @@ public class StateRotate extends StateCommon { StateType whenDone = StateType.DONE; - if (map.moveUnit(activeUnit, map.possiblePaths.orientation) > 0) + if (map.moveUnit(activeUnit) > 0) whenDone = StateType.MOVE; ctrl.setAnimationCount(1); |