summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/ch/asynk/rustanddust/engine/PathBuilder.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
index 0bb5241..581bb25 100644
--- a/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
+++ b/core/src/ch/asynk/rustanddust/engine/PathBuilder.java
@@ -120,6 +120,19 @@ public class PathBuilder implements Disposable
return getPaths().size();
}
+ public int buildShortest(Tile to)
+ {
+ clear();
+ this.to = to;
+ this.distance = board.distance(from, to);
+ findAllPaths(from, pawn.getMovementPoints(), 0, true);
+ chooseShortest();
+
+ // printToErr("paths", getPaths());
+ stack.clear();
+ return getPaths().size();
+ }
+
private void beSmart()
{
Tile o = null;