summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java33
1 files changed, 14 insertions, 19 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index cd715fb..ad92836 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -36,7 +36,7 @@ public abstract class Map extends Board
public void dispose()
{
super.dispose();
- resetPaths();
+ clearPossibles();
clearCoordinateVector(finalPath);
}
@@ -85,32 +85,22 @@ public abstract class Map extends Board
}
}
- public void showPossibleMoves(Pawn pawn, GridPoint2 hex, boolean enable)
+ public void buildAndShowPossibleMoves(Pawn pawn, GridPoint2 hex)
{
enablePossibleMoves(false);
- if (enable) {
- possibleMovesFrom(pawn, hex, possibleMoves);
- enablePossibleMoves(true);
- }
+ possibleMovesFrom(pawn, hex, possibleMoves);
+ enablePossibleMoves(true);
}
- public void showPossibleTargets(Pawn pawn, GridPoint2 hex, boolean enable)
+ public void buildAndShowPossibleTargets(Pawn pawn, GridPoint2 hex)
{
enablePossibleTargets(false);
- if (enable) {
- possibleTargetsFrom(pawn, hex, possibleTargets);
- enablePossibleTargets(true);
- }
+ possibleTargetsFrom(pawn, hex, possibleTargets);
+ enablePossibleTargets(true);
}
- public void showPossibleActions(Pawn pawn, GridPoint2 hex, boolean enable)
- {
- showPossibleMoves(pawn, hex, enable);
- showPossibleTargets(pawn, hex, enable);
- }
-
public int possiblePathsSize()
{
return possiblePaths.size();
@@ -134,20 +124,25 @@ public abstract class Map extends Board
}
}
- public void hidePaths()
+ public void hidePossibles()
{
enablePossibleTargets(false);
enablePossibleMoves(false);
enablePossiblePaths(false, false);
}
- public void resetPaths()
+ public void clearPossibles()
{
clearPointSet(possiblePaths);
clearPointVector(possibleMoves);
clearPointVector(possibleTargets);
}
+ public void clearPossiblePaths()
+ {
+ clearPointSet(possiblePaths);
+ }
+
public void toggleDotOverlay(GridPoint2 hex)
{
boolean enable= !isOverlayEnabledOn(hex, Hex.MOVE);