Import std.collections.grid
std.collections.grid
Grid<T> and Grid3<T>: a fixed number of values in columns and rows, and in layers too, read
and set by position, like a map's tiles or a volume's voxels. A position is (x, y), or (x, y,
z), each from 0, and one outside the Grid panics where it's used. The cells are in one array,
row by row, and layer by layer.
std/collections/grid.fb
Types
Grid
class
Public Class Grid<T> Implements Iterable<T>, Cloneable
A rectangle of cells, Width by Height, each a T, indexed as grid[x, y].
std/collections/grid.fb, line 10
-
A Grid
widthcells across andheightdown, each holdingfill. A negative size panics, and so does one with more cells than an Int counts. -
How many cells wide it is.
-
How many cells high it is.
-
How many cells it has, Width times Height.
-
Whether (
x,y) is one of the Grid's cells. -
The value at (
x,y). One outside the Grid panics. -
Sets the value at (
x,y) tovalue. One outside the Grid panics. -
The positions beside (
x,y) that are in the Grid: above, left, right, and below it. -
The positions around (
x,y) that are in the Grid, its corners too, row by row. -
Gives every cell the
value. -
The values, row by row, in a new array.
-
A new Grid with the same size and values.
-
The values, row by row.
GridIterator
struct
Public Struct GridIterator<T> Implements Iterator<T>
Goes over a Grid's or a Grid3's cells, which never change in number.
std/collections/grid.fb, line 112
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
Grid3
class
Public Class Grid3<T> Implements Iterable<T>, Cloneable
A box of cells, Width by Height by Depth, each a T, indexed as grid[x, y, z].
std/collections/grid.fb, line 146
-
A Grid3
widthcells across,heightdown, anddepthdeep, each holdingfill. A negative size panics, and so does one with more cells than an Int counts. -
How many cells wide it is.
-
How many cells high it is.
-
How many cells deep it is.
-
How many cells it has, Width times Height times Depth.
-
Whether (
x,y,z) is one of the Grid3's cells. -
The value at (
x,y,z). One outside the Grid3 panics. -
Sets the value at (
x,y,z) tovalue. One outside the Grid3 panics. -
The positions that share a face with (
x,y,z) and are in the Grid3: the layer before, then above, left, right, and below, then the layer after. -
The positions around (
x,y,z) that are in the Grid3, its edges and corners too, layer by layer and row by row. -
Gives every cell the
value. -
The values, layer by layer and row by row, in a new array.
-
A new Grid3 with the same size and values.
-
The values, layer by layer and row by row.
Extends
Grid
extend
Extend Grid<T> Implements Equatable
No doc comment.
std/collections/grid.fb, line 124
-
Whether
aandbare equal.Doc from
std.core.interfaces.Equatable.Operator==.
Grid
extend
Extend Grid<T> Implements Printable
No doc comment.
std/collections/grid.fb, line 133
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
Grid3
extend
Extend Grid3<T> Implements Equatable
No doc comment.
std/collections/grid.fb, line 281
-
Whether
aandbare equal.Doc from
std.core.interfaces.Equatable.Operator==.
Grid3
extend
Extend Grid3<T> Implements Printable
No doc comment.
std/collections/grid.fb, line 292
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
Report an issue with this page or with FutureBlitz on GitHub.