Class ExitIterator<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 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>
    An Iterator that returns all map squares containing an exit game object.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExitIterator​(@NotNull ExitMatcher<G,​A,​R> exitMatcher, @NotNull MapModel<G,​A,​R> mapModel, int xStart, int yStart, int direction)
      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

      • ExitIterator

        public ExitIterator​(@NotNull
                            @NotNull ExitMatcher<G,​A,​R> exitMatcher,
                            @NotNull
                            @NotNull MapModel<G,​A,​R> mapModel,
                            int xStart,
                            int yStart,
                            int direction)
        Creates a new instance.
        Parameters:
        exitMatcher - the exit matcher for selecting exit game objects
        mapModel - the map model to search
        xStart - the x coordinate to start seacrhing
        yStart - the y coordinate to start seacrhing
        direction - the search direction: -1 for backward or +1 for forward
    • Method Detail

      • hasNext

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

        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>>