diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-01-21 14:11:17 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-01-21 14:11:17 +0100 |
commit | 42a64e4e3767dc1b8f1a1cf5db5e10714d221973 (patch) | |
tree | 0f569870bf0782bb7dfa6b7b3099bcde54886c25 /core/src/ch/asynk/gdx/boardgame | |
parent | db2472e4a19945e87ce4ff599b94bcfd16e251ab (diff) | |
download | gdx-boardgame-42a64e4e3767dc1b8f1a1cf5db5e10714d221973.zip gdx-boardgame-42a64e4e3767dc1b8f1a1cf5db5e10714d221973.tar.gz |
Path : add show(int, int)
Diffstat (limited to 'core/src/ch/asynk/gdx/boardgame')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/Path.java | 14 |
1 files changed, 14 insertions, 0 deletions
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<Tile> 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()) { |