diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-16 15:02:45 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-10-16 15:02:45 +0200 |
commit | 3e558296857c9a0fe44dafc79075e5062a3c8771 (patch) | |
tree | 38d5fd7bcccc77a596ff420c6df81cce2901aded /core | |
parent | 9bd9fb592a3daaab1033e63b2202403da9517e4e (diff) | |
download | gdx-boardgame-3e558296857c9a0fe44dafc79075e5062a3c8771.zip gdx-boardgame-3e558296857c9a0fe44dafc79075e5062a3c8771.tar.gz |
Collection : add current()
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/utils/Collection.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/gdx/boardgame/utils/IterableArray.java | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/core/src/ch/asynk/gdx/boardgame/utils/Collection.java b/core/src/ch/asynk/gdx/boardgame/utils/Collection.java index ce22795..b546217 100644 --- a/core/src/ch/asynk/gdx/boardgame/utils/Collection.java +++ b/core/src/ch/asynk/gdx/boardgame/utils/Collection.java @@ -25,4 +25,6 @@ public interface Collection<E> extends Iterator, Iterable<E> public E remove(int idx); public boolean remove(E e); + + public E current(); } diff --git a/core/src/ch/asynk/gdx/boardgame/utils/IterableArray.java b/core/src/ch/asynk/gdx/boardgame/utils/IterableArray.java index b32e290..1edf84f 100644 --- a/core/src/ch/asynk/gdx/boardgame/utils/IterableArray.java +++ b/core/src/ch/asynk/gdx/boardgame/utils/IterableArray.java @@ -128,6 +128,11 @@ public class IterableArray<E> implements Collection<E> return (idx < s); } + @Override public E current() + { + return get(idx); + } + @Override public E next() { E e = get(idx); |