Large worlds · interface

FreezableWorld

What freezing needs of a world.

Explained in Coordinates and units.

interface FreezableWorld
import type { FreezableWorld } from '@driftengine/core';

In depth

Taken as a parameter rather than imported, on AGENTS.md's rule: core has no entity store and a consumer may be holding one of several. Five methods, all of which any store can answer.

Methods

entitiesIn

entitiesIn(cell: number): readonly number[]

Every entity whose home is this cell, live or not.

ParameterTypeDescription
cellnumber

readState

readState(entity: number, out: Float64Array): number

Write an entity's whole state into out and return how many values were written.

ParameterTypeDescription
entitynumber
outFloat64Array

writeState

writeState(entity: number, values: Float64Array, count: number): void

Put a state back, exactly.

ParameterTypeDescription
entitynumber
valuesFloat64Array
countnumber

simulating

simulating(entity: number): boolean
ParameterTypeDescription
entitynumber

setSimulating

setSimulating(entity: number, on: boolean): void
ParameterTypeDescription
entitynumber
onboolean