rectGrid

Convenience function to wrap a RectGrid around a 2D array.

rectGrid
(
T
)
()

Examples

auto dynamicArray = [
  [1,2,3],
  [4,5,6]
];
auto dynamicGrid = rectGrid(dynamicArray);
assert(dynamicGrid.numRows == 2 && dynamicGrid.numCols == 3);
static assert(is(dynamicGrid.TileType == int));

char[3][2] staticArray = [
  [ 'a', 'a', 'a' ],
  [ 'a', 'a', 'a' ],
];
auto staticGrid = rectGrid(staticArray);
assert(staticGrid.numRows == 2 && staticGrid.numCols == 3);
static assert(is(staticGrid.TileType == char));

Meta