diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-30 22:04:39 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-30 22:04:39 +0100 |
commit | 57f06d82d75e81f2ccafc1b232180cbf9b01ce3f (patch) | |
tree | 8973f0babdd052ca0e670d3e1a0cfe826cd7aa24 /core/src/ch/asynk/rustanddust/engine | |
parent | 4509673c9403c11b9312cf287a32e011eb92dd06 (diff) | |
download | RustAndDust-57f06d82d75e81f2ccafc1b232180cbf9b01ce3f.zip RustAndDust-57f06d82d75e81f2ccafc1b232180cbf9b01ce3f.tar.gz |
PathBuilder: toggleCtrlTile add boolean quick parameter
Diffstat (limited to 'core/src/ch/asynk/rustanddust/engine')
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/PathBuilder.java | 8 |
1 files changed, 4 insertions, 4 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(); |