Logo Mibo

Occupancy Type

The occupancy a build derives from a painted grid: the cell of every drawn instance, the rectangle each one covers, and which instance owns each cell. A plain cell owns itself; a spanning cell owns its whole rectangle. Every cell that carries a value also carries an owner, so a query no longer reads `ValueNone` for a cell that an instance covers from elsewhere. Build it once with `Occupancy.scan` and read it per frame.

Record fields

Record Field Description

Cells

Full Usage: Cells

Field type: CellPoint[]

Anchor index -> the anchor's cell.

Field type: CellPoint[]

Claimed

Full Usage: Claimed

Field type: int

How many covered cells held a value before a span claimed them, so they draw as part of the anchor instead of on their own.

Field type: int

Height

Full Usage: Height

Field type: int
Field type: int

Owner

Full Usage: Owner

Field type: int[]

Cell index (`x + y * Width`) -> anchor index + 1, or 0 where nothing covers the cell.

Field type: int[]

Rects

Full Usage: Rects

Field type: CellRect[]

Anchor index -> the anchor's bounding rectangle, in offset space.

Field type: CellRect[]

Width

Full Usage: Width

Field type: int
Field type: int

Type something to start searching.