Skip to content

BoundedGrid2

Defined in: bounded-grid2.ts:10

Bounded grid: fixed row and column counts.

Flat 1D storage: cells[row * cols + col].

T

new BoundedGrid2<T>(size): BoundedGrid2<T>

Defined in: bounded-grid2.ts:15

GridSize2

BoundedGrid2<T>

Grid2.constructor

readonly cells: (T | undefined)[]

Defined in: bounded-grid2.ts:13


readonly cols: number

Defined in: bounded-grid2.ts:12


readonly rows: number

Defined in: bounded-grid2.ts:11

canPlaceRect(rect): boolean

Defined in: grid2.ts:14

GridRect2

boolean

Grid2.canPlaceRect


clone(): BoundedGrid2<T>

Defined in: bounded-grid2.ts:22

BoundedGrid2<T>


contains(coord): boolean

Defined in: bounded-grid2.ts:30

GridCoord2

boolean

Grid2.contains


getCell(coord): T | undefined

Defined in: bounded-grid2.ts:39

GridCoord2

T | undefined

Grid2.getCell


getCells(): IterableIterator<[GridCoord2, T]>

Defined in: bounded-grid2.ts:46

IterableIterator<[GridCoord2, T]>


getFirstEmpty(): GridCoord2 | undefined

Defined in: bounded-grid2.ts:61

Returns the first empty cell in reading order (row-major), or undefined if the grid is full.

GridCoord2 | undefined


getRectNeighbors(rect): Set<T>

Defined in: grid2.ts:50

GridRect2

Set<T>

Grid2.getRectNeighbors


placeRect(rect, value): void

Defined in: grid2.ts:39

GridRect2

T

void

Grid2.placeRect


setCell(coord, value): void

Defined in: bounded-grid2.ts:72

GridCoord2

T

void

Grid2.setCell