Class TopLevelGameObjectIterator<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>

  • All Implemented Interfaces:
    java.util.Iterator<G>

    public class TopLevelGameObjectIterator<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 for iterating over top-level game object of a map model.
    • Constructor Summary

      Constructors 
      Constructor Description
      TopLevelGameObjectIterator​(@NotNull MapModel<G,​A,​R> mapModel, @NotNull 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()  
      G 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

      • TopLevelGameObjectIterator

        public TopLevelGameObjectIterator​(@NotNull
                                          @NotNull MapModel<G,​A,​R> mapModel,
                                          @NotNull
                                          @NotNull java.awt.Point start,
                                          int direction,
                                          boolean skipFirst)
        Creates a new instance.
        Parameters:
        mapModel - the map model to iterate over
        start - the starting point
        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

      • hasNext

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

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

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