summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-04-07 09:30:30 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-04-07 09:30:30 +0200
commit44c3122312d171e91a67f2374a4c3241d69964eb (patch)
tree507782d7b97e81314f06ea573f358db64509881f /core/src/ch
parentdef6c5e10c04f62d050f5743ca3da25bf294d03c (diff)
downloadRustAndDust-44c3122312d171e91a67f2374a4c3241d69964eb.zip
RustAndDust-44c3122312d171e91a67f2374a4c3241d69964eb.tar.gz
Path: add toString()
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/rustanddust/engine/Path.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Path.java b/core/src/ch/asynk/rustanddust/engine/Path.java
index 72dcb38..68f1cdc 100644
--- a/core/src/ch/asynk/rustanddust/engine/Path.java
+++ b/core/src/ch/asynk/rustanddust/engine/Path.java
@@ -64,4 +64,13 @@ public class Path implements Disposable, Pool.Poolable
tiles.clear();
pathPool.free(this);
}
+
+ @Override
+ public String toString()
+ {
+ String s = String.format("path(c:%d - r:%b - f:%d)\n", cost, roadMarch, fitness);
+ for (Tile t : tiles)
+ s += String.format(" %s\n", t.toString());
+ return s;
+ }
}