Class MapSquareIterator<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<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
      boolean hasNext()  
      MapSquare<G,​A,​R> next()  
      void remove()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • 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 over
        start - the starting point or null for default
        direction - the direction to iterate: +1 for forward, -1 for backward
        skipFirst - whether to skip the first map square and return it at the end
    • Method Detail

      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<G extends GameObject<G,​A,​R>>
      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<G extends GameObject<G,​A,​R>>
      • next

        public MapSquare<G,​A,​R> next()
        Specified by:
        next in interface java.util.Iterator<G extends GameObject<G,​A,​R>>