indexed property
Each cell in the grid with its x and y coordinates.
The order of the cells are based on the grid's internal memory layout,
but each x
and y
coordinate is also provided for each cell, which
makes this getter more useful than cells in many cases.
See also:
Implementation
Iterable<(int x, int y, T cell)> get indexed {
return Iterable.generate(
height,
(y) => Iterable.generate(
width,
(x) => (x, y, get(x, y)),
),
).expand((row) => row);
}