MCPcopy Create free account
hub / github.com/Noumena-Network/code / isEmptyCellByIndex

Function isEmptyCellByIndex

src/ink/screen.ts:453–458  ·  view source on GitHub ↗
(screen: Screen, index: number)

Source from the content-addressed store, hash-verified

451}
452
453function isEmptyCellByIndex(screen: Screen, index: number): boolean {
454 // An empty/unwritten cell has both words === 0:
455 // word0 = EMPTY_CHAR_INDEX (0), word1 = packWord1(emptyStyleId=0, 0, 0) = 0.
456 const ci = index << 1
457 return screen.cells[ci] === 0 && screen.cells[ci | 1] === 0
458}
459
460export function isEmptyCellAt(screen: Screen, x: number, y: number): boolean {
461 if (x < 0 || y < 0 || x >= screen.width || y >= screen.height) return true

Callers 1

isEmptyCellAtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected