20 package net.sf.gridarta.model.mapmodel;
22 import java.awt.Point;
23 import java.util.Iterator;
24 import java.util.NoSuchElementException;
28 import org.jetbrains.annotations.NotNull;
29 import org.jetbrains.annotations.Nullable;
74 return gameObject != null;
82 throw new NoSuchElementException();
89 public void remove() {
90 throw new UnsupportedOperationException();
98 if (gameObjectIterator != null) {
99 if (gameObjectIterator.hasNext()) {
100 assert gameObjectIterator != null;
101 gameObject = gameObjectIterator.next();
104 gameObjectIterator = null;
107 if (!mapSquareIterator.hasNext()) {
113 if (!mapSquare.isEmpty()) {
114 gameObjectIterator = mapSquare.iterator();
TopLevelGameObjectIterator(@NotNull final MapModel< G, A, R > mapModel, @NotNull final Point start, final int direction, final boolean skipFirst)
Creates a new instance.
Iterator for iterating over top-level game object of a map model.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
G gameObject
The GameObject to return from the next call to next() or.
GameObjects are the objects based on Archetypes found on maps.
void findNext()
Updates gameObject to contain the next top-level game object.
final Iterator< MapSquare< G, A, R > > mapSquareIterator
The Iterator returning all MapSquares to consider.
Interface for MapArchObjects.
Iterator< G > gameObjectIterator
The Iterator returning all top-level game objects in the current map square or.
Iterator for iterating over all squares of a model.