public class ExitIterator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
implements java.util.Iterator<G>
Iterator that returns all map squares containing an exit game
object.| Constructor and Description |
|---|
ExitIterator(@NotNull ExitMatcher<G,A,R> exitMatcher,
@NotNull MapModel<G,A,R> mapModel,
int xStart,
int yStart,
int direction)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
G |
next() |
void |
remove() |
public ExitIterator(@NotNull
@NotNull ExitMatcher<G,A,R> exitMatcher,
@NotNull
@NotNull MapModel<G,A,R> mapModel,
int xStart,
int yStart,
int direction)
exitMatcher - the exit matcher for selecting exit game objectsmapModel - the map model to searchxStart - the x coordinate to start seacrhingyStart - the y coordinate to start seacrhingdirection - the search direction: -1 for backward or +1 for forwardpublic boolean hasNext()
hasNext in interface java.util.Iterator<G extends GameObject<G,A,R>>public G next()
next in interface java.util.Iterator<G extends GameObject<G,A,R>>public void remove()
remove in interface java.util.Iterator<G extends GameObject<G,A,R>>