Skip to content

StripGrid2

Defined in: strip-grid2.ts:16

Strip grid: fixed column count, unbounded row count. Row-major storage: cells[row][col].

T

new StripGrid2<T>(cols): StripGrid2<T>

Defined in: strip-grid2.ts:20

number

StripGrid2<T>

Grid2.constructor

readonly cells: (T | undefined)[][]

Defined in: strip-grid2.ts:18


readonly cols: number

Defined in: strip-grid2.ts:17

canPlaceRect(rect): boolean

Defined in: grid2.ts:14

GridRect2

boolean

Grid2.canPlaceRect


clearRect(rect): void

Defined in: strip-grid2.ts:26

GridRect2

void


clone(): StripGrid2<T>

Defined in: strip-grid2.ts:38

StripGrid2<T>


contains(coord): boolean

Defined in: strip-grid2.ts:50

Returns true if the coordinate is within the fixed column bounds. Rows are unbounded.

GridCoord2

boolean

Grid2.contains


getCell(coord): T | undefined

Defined in: strip-grid2.ts:54

GridCoord2

T | undefined

Grid2.getCell


getCells<O>(options?): IterableIterator<[GridCoord2, O["skipEmpty"] extends true ? T : T | undefined]>

Defined in: strip-grid2.ts:61

O extends StripGrid2GetCellsOptions

O

IterableIterator<[GridCoord2, O["skipEmpty"] extends true ? T : T | undefined]>


getFilledRowCount(): number

Defined in: strip-grid2.ts:87

Returns the number of rows that contain at least one set cell.

number


getFirstEmpty(): GridCoord2

Defined in: strip-grid2.ts:97

Returns the first empty cell in reading order (row-major).

GridCoord2


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: strip-grid2.ts:107

GridCoord2

T

void

Grid2.setCell