summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/engine/PathBuilder.java (renamed from core/src/ch/asynk/tankontank/engine/PossiblePaths.java)4
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java26
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateBreak.java6
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateExit.java6
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java26
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateRotate.java14
6 files changed, 41 insertions, 41 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/PossiblePaths.java b/core/src/ch/asynk/tankontank/engine/PathBuilder.java
index b54835e..a227b01 100644
--- a/core/src/ch/asynk/tankontank/engine/PossiblePaths.java
+++ b/core/src/ch/asynk/tankontank/engine/PathBuilder.java
@@ -10,7 +10,7 @@ import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
-public class PossiblePaths implements Disposable
+public class PathBuilder implements Disposable
{
private final Board board;
@@ -25,7 +25,7 @@ public class PossiblePaths implements Disposable
private List<Path> filteredPaths;
private HashSet<Tile> tiles;
- public PossiblePaths(Board board, int tSize, int stSize, int ftSize, int vectSize)
+ public PathBuilder(Board board, int tSize, int stSize, int ftSize, int vectSize)
{
this.board = board;
this.tiles = new LinkedHashSet<Tile>(tSize);
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 76369af..d0b461b 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -15,7 +15,7 @@ import ch.asynk.tankontank.engine.Move;
import ch.asynk.tankontank.engine.SelectedTile;
import ch.asynk.tankontank.engine.Orientation;
import ch.asynk.tankontank.engine.Meteorology;
-import ch.asynk.tankontank.engine.PossiblePaths;
+import ch.asynk.tankontank.engine.PathBuilder;
import ch.asynk.tankontank.engine.gfx.Animation;
import ch.asynk.tankontank.engine.gfx.animations.AnimationSequence;
import ch.asynk.tankontank.engine.gfx.animations.DiceAnimation;
@@ -36,7 +36,7 @@ public abstract class Map extends Board
private Random rand = new Random();
public final HexSet possibleMoves;
- public final PossiblePaths possiblePaths;
+ public final PathBuilder pathBuilder;
public final UnitList moveableUnits;
public final UnitList possibleTargets;
@@ -124,7 +124,7 @@ public abstract class Map extends Board
setup();
possibleMoves = new HexSet(this, 40);
- possiblePaths = new PossiblePaths(this, 10, 20, 5, 10);
+ pathBuilder = new PathBuilder(this, 10, 20, 5, 10);
moveableUnits = new UnitList(6);
possibleTargets = new UnitList(10);
@@ -144,7 +144,7 @@ public abstract class Map extends Board
super.dispose();
clearAll();
destroy.dispose();
- possiblePaths.dispose();
+ pathBuilder.dispose();
DiceAnimation.free();
PromoteAnimation.free();
FireAnimation.free();
@@ -154,7 +154,7 @@ public abstract class Map extends Board
{
possibleMoves.clear();
possibleTargets.clear();
- possiblePaths.clear();
+ pathBuilder.clear();
moveableUnits.clear();
engagementAssists.clear();
activatedUnits.clear();
@@ -190,9 +190,9 @@ public abstract class Map extends Board
return collectPossibleMoves(unit, possibleMoves.asTiles());
}
- public int togglePossiblePathHex(Hex hex)
+ public int togglePathBuilderHex(Hex hex)
{
- return possiblePaths.toggleCtrlTile(hex);
+ return pathBuilder.toggleCtrlTile(hex);
}
public int collectPossibleTargets(Unit unit, UnitList foes)
@@ -328,7 +328,7 @@ public abstract class Map extends Board
// unit.reset();
// }
- return process(unit, possiblePaths.getExitMove());
+ return process(unit, pathBuilder.getExitMove());
}
public void promoteUnit(final Player player, final Unit unit)
@@ -350,7 +350,7 @@ public abstract class Map extends Board
public int moveUnit(Unit unit)
{
- return process(unit, possiblePaths.getMove());
+ return process(unit, pathBuilder.getMove());
}
public void revertMoves()
@@ -556,10 +556,10 @@ public abstract class Map extends Board
public void showPossibleMoves() { possibleMoves.enable(Hex.AREA, true); }
public void hidePossibleMoves() { possibleMoves.enable(Hex.AREA, false); }
- public void showPossiblePaths() { possiblePaths.enable(Hex.AREA, true); }
- public void hidePossiblePaths() { possiblePaths.enable(Hex.AREA, false); }
- public void showPath(Hex dst) { possiblePaths.enable(Hex.MOVE, true); showMove(dst); }
- public void hidePath(Hex dst) { possiblePaths.enable(Hex.MOVE, false); hideMove(dst); }
+ public void showPathBuilder() { pathBuilder.enable(Hex.AREA, true); }
+ public void hidePathBuilder() { pathBuilder.enable(Hex.AREA, false); }
+ public void showPath(Hex dst) { pathBuilder.enable(Hex.MOVE, true); showMove(dst); }
+ public void hidePath(Hex dst) { pathBuilder.enable(Hex.MOVE, false); hideMove(dst); }
public void selectHex(Hex hex) { selectedTile.set(hex); }
public void unselectHex(Hex hex) { selectedTile.hide(); }
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) {