From ab3d35d5934f18389da595518ece59a829a756f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 6 Oct 2014 11:09:16 +0200 Subject: Map: showPossibleActions(...) calls showPossibleTargets(...) and showPossibleMoves(...) add enableDirections(...) --- core/src/ch/asynk/tankontank/game/Map.java | 24 +++++++++++++++++++++--- 1 file 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); } } -- cgit v1.1-2-g2b99