From 42a64e4e3767dc1b8f1a1cf5db5e10714d221973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 21 Jan 2020 14:11:17 +0100 Subject: Path : add show(int, int) --- core/src/ch/asynk/gdx/boardgame/Path.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core/src/ch/asynk/gdx/boardgame/Path.java b/core/src/ch/asynk/gdx/boardgame/Path.java index 10b26c9..a7e1d5e 100644 --- a/core/src/ch/asynk/gdx/boardgame/Path.java +++ b/core/src/ch/asynk/gdx/boardgame/Path.java @@ -70,6 +70,20 @@ public class Path extends IterableArray implements Disposable, Pool.Poolab return to; } + public void show(int i, int j) + { + Tile prev = null; + for (int n = 0; n < size(); n++) { + final Tile tile = get(n); + if (prev != null) { + final Orientation o = Orientation.fromTiles(prev, tile); + prev.enableOverlay(i, o); + tile.enableOverlay(j, o.opposite()); + } + prev = tile; + } + } + public boolean nextPosition(Piece piece, Vector3 v) { if (hasNext()) { -- cgit v1.1-2-g2b99