summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-06 11:09:16 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-06 11:09:16 +0200
commitab3d35d5934f18389da595518ece59a829a756f7 (patch)
tree5512994d2a9928ebe79a48df41b1b4f183adf1b7 /core/src/ch/asynk/tankontank/game
parenta424d4d54d75ce53eb51932620df6f0931a2f9f0 (diff)
downloadRustAndDust-ab3d35d5934f18389da595518ece59a829a756f7.zip
RustAndDust-ab3d35d5934f18389da595518ece59a829a756f7.tar.gz
Map: showPossibleActions(...) calls showPossibleTargets(...) and showPossibleMoves(...) add enableDirections(...)
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java24
1 files changed, 21 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index c67d3d7..bef7422 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -82,19 +82,32 @@ public abstract class Map extends Board
}
}
- public void showPossibleActions(Pawn pawn, GridPoint2 hex, boolean enable)
+ public void showPossibleMoves(Pawn pawn, GridPoint2 hex, boolean enable)
{
enablePossibleMoves(false);
- enablePossibleTargets(false);
if (enable) {
possibleMovesFrom(pawn, hex, possibleMoves);
enablePossibleMoves(true);
+ }
+
+ }
+
+ public void showPossibleTargets(Pawn pawn, GridPoint2 hex, boolean enable)
+ {
+ enablePossibleTargets(false);
+ if (enable) {
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();
@@ -144,6 +157,11 @@ public abstract class Map extends Board
enableOverlayOn(hex, Hex.GREEN, false);
enableOverlayOn(hex, Hex.MOVE, enable);
}
- enableOverlayOn(dst, Hex.ROSE, enable);
+ enableDirections(dst, enable);
+ }
+
+ public void enableDirections(GridPoint2 hex, boolean enable)
+ {
+ enableOverlayOn(hex, Hex.ROSE, enable);
}
}