diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-01 20:53:08 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-01 20:53:08 +0200 |
commit | faf8301a06f171539f7e7ad3b9034c54aa740c31 (patch) | |
tree | 870db64cd9f960ce9f6ced685c665ba426e1eabd | |
parent | f693542375b099c662c05cc7a5d5fb8b97bf9dd2 (diff) | |
download | RustAndDust-faf8301a06f171539f7e7ad3b9034c54aa740c31.zip RustAndDust-faf8301a06f171539f7e7ad3b9034c54aa740c31.tar.gz |
Map: use toggleDotOverlay() instead of enableOverlayOn() for Hex.DOT
-rw-r--r-- | core/src/ch/asynk/tankontank/game/Map.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 54d1a16..908007a 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -83,8 +83,8 @@ public abstract class Map extends Board action = Action.PATH; if (possiblePaths.size() > 0) { enablePossiblePaths(false, true); - paths = possiblePathsFilterAdd(touchHex.x, touchHex.y, possiblePaths); - enableOverlayOn(touchHex.x, touchHex.y, Hex.DOT, true); + paths = possiblePathsFilterToggle(touchHex.x, touchHex.y, possiblePaths); + toggleDotOverlay(touchHex.x, touchHex.y); } else { enablePossibleMoves(false); from.set(hex.x, hex.y); @@ -144,6 +144,12 @@ public abstract class Map extends Board enableOverlayOn(hex.x, hex.y, Hex.GREEN, enable); } + private void toggleDotOverlay(int col, int row) + { + boolean enable= !isOverlayEnabledOn(col, row, Hex.DOT); + enableOverlayOn(col, row, Hex.DOT, enable); + } + private void enableFinalPath(boolean enable) { for(GridPoint2 hex : possiblePaths) { |