In-game tools · function

entitiesInspectable

An entity world, as something the inspector can read and edit.

Explained in In-game tools.

function entitiesInspectable<T extends InspectableComponentType>(world: EntityWorldLike<T>, types: readonly T[]): InspectableWorld
import { entitiesInspectable } from '@driftengine/tools';

Parameters

ParameterTypeDescription
worldEntityWorldLike<T>
typesreadonly T[]

In depth

Written once here because every consumer with a world was about to write it. The inspector addresses a component by name, since a name is what a row carries; a world addresses it by the type object, since that is what indexes its stores. Bridging the two is seven forwarding methods and a lookup, identical wherever it is written.

A name with no type behind it does nothing rather than guessing. A row built against a stale schema would otherwise write a field into a component the world does not have and report success, which is a silent loss of the edit a person just made and watched apply.

componentsOf answers in the order the types were given, so a panel's rows do not reorder between frames.