Grid

Represents a 2d grid like an array. To encapsulate the whole [y*width + x] thing.

Constructors

this
this(Size size)
this(int width, int height)

Creates a new GC-backed array

this
this(T[] array, Size size)

Wraps an existing array.

Members

Functions

inBounds
bool inBounds(int x, int y)
inBounds
bool inBounds(Point pt)
opBinaryRight
bool opBinaryRight(Point pt)

Supports if(point in grid) {}

opIndex
inout(T)[] opIndex()

Slice operation gives a view into the underlying 1d array.

opIndex
inout(T) opIndex(int x, int y)
opIndex
inout(T) opIndex(Point pt)

Properties

height
int height [@property getter]
size
inout(Size) size [@property getter]
width
int width [@property getter]

Meta

History

Added May 3, 2020