Entities · function
serializeWorld
Write a world out.
Explained in Entities.
function serializeWorld(world: World, types: readonly ComponentType[]): SerializedSceneimport { serializeWorld } from '@driftengine/entities';Parameters
| Parameter | Type | Description |
|---|---|---|
world | World | |
types | readonly ComponentType[] |
In depth
The component types are passed rather than discovered, because a world holds a store for every type anything has ever asked it about — including empty ones a query created — and a scene is a decision about what to save rather than everything that happens to exist.