Class GridIterator.VerticalUp

java.lang.Object
com.github.yellowstonegames.grid.GridIterator
com.github.yellowstonegames.grid.GridIterator.VerticalUp
All Implemented Interfaces:
Iterator<Coord>
Enclosing class:
GridIterator

public static class GridIterator.VerticalUp extends GridIterator
An iterator to iterate from a starting position (exclusive) and going up. This iterator cycles when reaching the map's bound, but it iterates at most once on a cell, i.e. it does at most one roll over a column of the map.
  • Field Details

    • xStart

      protected int xStart
      The starting X-coordinate
    • yStart

      protected int yStart
      The starting Y-coordinate
    • prev

      protected Coord prev
      Initially null
  • Constructor Details

    • VerticalUp

      public VerticalUp(int xStart, int yStart, int width, int height)
      An iterator to iterate vertically, starting AFTER (startx, starty). This iterates cycles when it reaches the map's bound, but it iterates at most once on a cell, i.e. it does at most one roll over a column of the map.
      Parameters:
      xStart - The starting X-coordinate.
      yStart - The starting vertical-coordinate.
      width - The map's width.
      height - The map's height.
    • VerticalUp

      public VerticalUp(Coord start, int width, int height)
      An iterator to iterate vertically, starting AFTER start. This iterates cycles when it reaches the map's bound, but it iterates at most once on a cell, i.e. it does at most one roll over a column of the map.
      Parameters:
      start - The starting coordinate.
      width - The map's width.
      height - The map's height.
  • Method Details

    • hasNext

      public boolean hasNext()
    • next

      public Coord next()
    • remove

      public void remove()
    • findNext

      protected Coord findNext()