Skip to content

1681-engine / index / Prefab

Interface: Prefab<A> ​

Defined in: src/ecs/prefab.ts:30

A template for entities: the components each gets, with their starting values.

Type Parameters ​

Type ParameterDefault type
Aunknown

Properties ​

base ​

ts
readonly base: Prefab<A> | null;

Defined in: src/ecs/prefab.ts:34


name ​

ts
readonly name: string;

Defined in: src/ecs/prefab.ts:31


parts ​

ts
readonly parts: ReadonlyMap<ComponentType<unknown>, unknown>;

Defined in: src/ecs/prefab.ts:33

The components, the base's merged in: a variant's plain-object values are laid over the base's field by field.

Released under the MIT License.