From 44c3122312d171e91a67f2374a4c3241d69964eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Thu, 7 Apr 2016 09:30:30 +0200 Subject: Path: add toString() --- core/src/ch/asynk/rustanddust/engine/Path.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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; + } } -- cgit v1.1-2-g2b99