Skip to content

PrefabInstance beta ​

Interface of @v12-engine/editor

ts
export interface PrefabInstance

An instance of a prefab on a map, as the map keeps it (GameMap.editor, EditorMapData.prefabs): the engine reads none of it; its parts are the map's own things

Members ​

ground ​

ts
ground?: {
        rect: CellRect;
        quarters: number;
        placed: PrefabGround;
    };

The ground it wrote, when the prefab brought ground: where, turned by how many quarters, and as it was then (an update writes only where the map still has it)

id ​

ts
id: number;

The instance's id on the map, which its parts are told from

left ​

ts
left?: Partial<Record<string, number[]>>;

Parts left out on purpose as it was placed (a placement's variation), by kind and the prefab's own id: never brought back by an update

parts ​

ts
parts: PrefabParts;

The ids of the map things the instance placed, by kind

placed ​

ts
placed: MapClip;

What was expanded, as the prefab had it then: what a change of the designer's is told from

prefab ​

ts
prefab: string;

The prefab's name

sources ​

ts
sources?: Record<string, number>;

The versions of the other prefabs it was unpacked from (a variant's source, the prefabs inside it): a newer one puts it behind

version ​

ts
version: number;

The prefab's version it was expanded from, or brought up to last