diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 16:11:46 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-06 16:11:46 +0200 |
commit | 413470de7d87de33752930a67a7e8d65c5f9032f (patch) | |
tree | 417d4f3cb5f3da4cf71e20d37c62bf1240e4ddf0 /core/src/ch/asynk | |
parent | 6e1c9e115cd513c358be8d45ad84f2bf31202d2c (diff) | |
download | RustAndDust-413470de7d87de33752930a67a7e8d65c5f9032f.zip RustAndDust-413470de7d87de33752930a67a7e8d65c5f9032f.tar.gz |
Map: clarify show enable clear Moves Paths, Targes API
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 33 |
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); |