From 57f06d82d75e81f2ccafc1b232180cbf9b01ce3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 30 Dec 2015 22:04:39 +0100 Subject: PathBuilder: toggleCtrlTile add boolean quick parameter --- core/src/ch/asynk/rustanddust/engine/PathBuilder.java | 8 ++++---- core/src/ch/asynk/rustanddust/game/map/Map2Moves.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java index 6097d87..ae4c3fb 100644 --- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java +++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java @@ -184,16 +184,16 @@ public class PathBuilder implements Disposable } } - public int toggleCtrlTile(Tile tile) + public int toggleCtrlTile(Tile tile, boolean quick) { if (ctrlTiles.contains(tile)) ctrlTiles.remove(tile); else ctrlTiles.add(tile); - return filterPaths(); + return filterPaths(quick); } - private int filterPaths() + private int filterPaths(boolean quick) { int s = ctrlTiles.size(); @@ -206,7 +206,7 @@ public class PathBuilder implements Disposable ok += 1; } if (ok == s) { - if (path.tiles.size() == (s + 0)) { // from and to are not part of the path + if (quick && path.tiles.size() == (s + 0)) { // from and to are not part of the path filteredPaths.clear(); filteredPaths.add(path); tiles.clear(); diff --git a/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java b/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java index 3a29e95..239e38e 100644 --- a/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java +++ b/core/src/ch/asynk/rustanddust/game/map/Map2Moves.java @@ -79,7 +79,7 @@ public abstract class Map2Moves extends Map1Units { boolean enable = !hex.isOverlayEnabled(Hex.MOVE); enableOverlayOn(hex, Hex.MOVE, enable); - return paths.toggleCtrlTile(hex); + return paths.toggleCtrlTile(hex, true); } public void movesShow() { moves.enable(Hex.AREA, true); } -- cgit v1.1-2-g2b99