diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-20 17:03:12 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-20 17:03:12 +0100 |
commit | 7719aaf6334b0425d42aeb579153c0b86ce613ee (patch) | |
tree | 9f8a173c6e5d8b3c2da67fd71f1c771c5b1bf6f0 /core/src/ch/asynk/tankontank/game/states | |
parent | be3948fb249ebe2724f3de160b4d9869d165e4e1 (diff) | |
download | RustAndDust-7719aaf6334b0425d42aeb579153c0b86ce613ee.zip RustAndDust-7719aaf6334b0425d42aeb579153c0b86ce613ee.tar.gz |
PossiblePaths -> PathBuilder
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/states')
4 files changed, 26 insertions, 26 deletions
diff --git a/core/src/ch/asynk/tankontank/game/states/StateBreak.java b/core/src/ch/asynk/tankontank/game/states/StateBreak.java index 91fae11..95ca24b 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateBreak.java +++ b/core/src/ch/asynk/tankontank/game/states/StateBreak.java @@ -78,9 +78,9 @@ public class StateBreak extends StateCommon { if (activeUnit == null) return; - map.possiblePaths.init(activeUnit); - if (map.possiblePaths.build(to) == 1) { - map.possiblePaths.orientation = o; + map.pathBuilder.init(activeUnit); + if (map.pathBuilder.build(to) == 1) { + map.pathBuilder.orientation = o; map.moveUnit(activeUnit); ctrl.setAnimationCount(1); ctrl.setAfterAnimationState(StateType.DONE); diff --git a/core/src/ch/asynk/tankontank/game/states/StateExit.java b/core/src/ch/asynk/tankontank/game/states/StateExit.java index f1dadba..f8edf03 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateExit.java +++ b/core/src/ch/asynk/tankontank/game/states/StateExit.java @@ -50,13 +50,13 @@ public class StateExit extends StateCommon Hex hex = unit.getHex(); if (selectedHex == hex) - map.possiblePaths.build(hex); + map.pathBuilder.build(hex); - Hex exitHex = (Hex) map.possiblePaths.to; + Hex exitHex = (Hex) map.pathBuilder.to; if (!exitZone.contains(exitHex)) throw new RuntimeException(String.format("%s not in exitZone", exitHex)); - map.possiblePaths.setExit(exitZone.orientation); + map.pathBuilder.setExit(exitZone.orientation); unit.hideMoveable(); if (to != null) diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java index fb5be50..4794d35 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateMove.java +++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java @@ -15,18 +15,18 @@ public class StateMove extends StateCommon | (ctrl.cfg.canCancel ? Buttons.ABORT.b : 0)); if (prevState == StateType.ESCAPE) { - if (map.possiblePaths.size() == 1) + if (map.pathBuilder.size() == 1) ctrl.setState(StateType.ROTATE); return; } - map.possiblePaths.clear(); + map.pathBuilder.clear(); if (prevState == StateType.SELECT) { // use selectedHex and selectedUnit activeUnit = selectedUnit; activeUnit.showMoveable(); - map.possiblePaths.init(activeUnit); + map.pathBuilder.init(activeUnit); map.collectAndShowMovesAndAssits(activeUnit); if (to != null) { // quick move -> replay touchUp @@ -104,12 +104,12 @@ public class StateMove extends StateCommon if (to !=null) map.hidePath(to); to = null; - map.possiblePaths.clear(); + map.pathBuilder.clear(); ctrl.setState(StateType.ROTATE); return; } - int s = map.possiblePaths.size(); + int s = map.pathBuilder.size(); Unit unit = upHex.getUnit(); @@ -118,7 +118,7 @@ public class StateMove extends StateCommon changeUnit(unit); } else if ((s == 0) && map.possibleMoves.contains(upHex)) { s = collectPaths(upHex); - } else if (map.possiblePaths.contains(upHex)) { + } else if (map.pathBuilder.contains(upHex)) { s = togglePoint(downHex, s); } @@ -142,7 +142,7 @@ public class StateMove extends StateCommon } activeUnit = unit; Hex hex = activeUnit.getHex(); - map.possiblePaths.init(activeUnit, hex); + map.pathBuilder.init(activeUnit, hex); activeUnit.showMoveable(); map.hidePossibleMoves(); map.collectPossibleMoves(activeUnit); @@ -156,10 +156,10 @@ public class StateMove extends StateCommon private int collectPaths(Hex hex) { to = hex; - int s = map.possiblePaths.build(to); + int s = map.pathBuilder.build(to); map.showMove(to); map.hidePossibleMoves(); - map.showPossiblePaths(); + map.showPathBuilder(); return s; } @@ -170,10 +170,10 @@ public class StateMove extends StateCommon } else if (hex == to) { // } else { - map.hidePossiblePaths(); + map.hidePathBuilder(); map.togglePathOverlay(hex); - s = map.togglePossiblePathHex(hex); - map.showPossiblePaths(); + s = map.togglePathBuilderHex(hex); + map.showPathBuilder(); } return s; @@ -184,7 +184,7 @@ public class StateMove extends StateCommon Zone exitZone = ctrl.battle.getExitZone(unit); if ((exitZone == null) || !exitZone.contains(hex)) return false; - if ((unit.getHex() != hex) && !map.possiblePaths.canExit(exitZone.orientation)) + if ((unit.getHex() != hex) && !map.pathBuilder.canExit(exitZone.orientation)) return false; ctrl.setState(StateType.ESCAPE); return true; diff --git a/core/src/ch/asynk/tankontank/game/states/StateRotate.java b/core/src/ch/asynk/tankontank/game/states/StateRotate.java index 4331d3d..6b60dfb 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateRotate.java +++ b/core/src/ch/asynk/tankontank/game/states/StateRotate.java @@ -20,13 +20,13 @@ public class StateRotate extends StateCommon if (to == null) to = activeUnit.getHex(); - if (!map.possiblePaths.isSet()) { - map.possiblePaths.init(activeUnit); - map.possiblePaths.build(to); + if (!map.pathBuilder.isSet()) { + map.pathBuilder.init(activeUnit); + map.pathBuilder.build(to); } - if (map.possiblePaths.size() != 1) - TankOnTank.debug("ERROR: possiblePaths.size() == " + map.possiblePaths.size()); + if (map.pathBuilder.size() != 1) + TankOnTank.debug("ERROR: pathBuilder.size() == " + map.pathBuilder.size()); rotateOnly = (to == activeUnit.getHex()); @@ -45,7 +45,7 @@ public class StateRotate extends StateCommon map.hidePath(to); map.hideDirections(to); map.hideOrientation(to); - map.possiblePaths.clear(); + map.pathBuilder.clear(); to = null; } @@ -97,7 +97,7 @@ public class StateRotate extends StateCommon if (!activeUnit.justEntered() && rotateOnly && (o == activeUnit.getOrientation())) return; - map.possiblePaths.orientation = o; + map.pathBuilder.orientation = o; rotationSet = true; if (ctrl.cfg.mustValidate) { |