Package squidpony.squidgrid.iterator
Class SquidIterators.RectangleFromBottomLeftToTopRight
java.lang.Object
squidpony.squidgrid.iterator.SquidIterators.RectangleFromBottomLeftToTopRight
- All Implemented Interfaces:
Iterator<Coord>
,SquidIterator
- Enclosing class:
- SquidIterators
public static class SquidIterators.RectangleFromBottomLeftToTopRight extends Object implements SquidIterator
An iterator that starts from a cell and iterates from the bottom left to
the top right, in the rectangle defined by the given width and height.
Widths and heights are like list-sizes w.r.t indexes. So a rectangle of
width or height 0 is empty, a rectangle of width and height 1 has one
cell, a rectangle of width and height 2 has four cells, etc.
Put differently, the rectangle whose bottom left is (x, y) and has width and height 2, contains the cells (x, y), (x + 1, y), (x, y - 1), and (x + 1, y - 1); but it does NOT contain (x + 2, y), nor (x + 2, y - 1), nor (x + 2, y - 2).
- Author:
- smelC