Package net.sf.gridarta.model.mapmodel
Class MapSquareIterator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.model.mapmodel.MapSquareIterator<G,A,R>
-
- All Implemented Interfaces:
java.util.Iterator<MapSquare<G,A,R>>
public class MapSquareIterator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements java.util.Iterator<MapSquare<G,A,R>>
Iterator for iterating over all squares of a model.
-
-
Constructor Summary
Constructors Constructor Description MapSquareIterator(@NotNull MapModel<G,A,R> mapModel, @Nullable java.awt.Point start, int direction, boolean skipFirst)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()MapSquare<G,A,R>next()voidremove()
-
-
-
Constructor Detail
-
MapSquareIterator
public MapSquareIterator(@NotNull @NotNull MapModel<G,A,R> mapModel, @Nullable @Nullable java.awt.Point start, int direction, boolean skipFirst)Creates a new instance.- Parameters:
mapModel- the map model to iterate overstart- the starting point ornullfor defaultdirection- the direction to iterate:+1for forward,-1for backwardskipFirst- whether to skip the first map square and return it at the end
-
-
Method Detail
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<G extends GameObject<G,A,R>>
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<G extends GameObject<G,A,R>>
-
-