Skip to content

PlacedSpec beta ​

Interface of @v12-engine/editor

ts
export interface PlacedSpec

What a tool that puts one down with a click, picks one with a press and moves it with a drag works on (PlacedTool): a kind of thing that stands at a place. The lights, the effects, the points and the sounds each say theirs

Members ​

add ​

ts
add(ground: Vec2): number | undefined;

Puts a new one down at a place, as one step: its id, or nothing where none can go

at ​

ts
at(pointer: ToolPointer, ground: Vec2): number | undefined;

The one a press is on, if any, by its id

kind ​

ts
readonly kind: CollectionId;

Which kind of thing it is: what the map's symmetry puts down again with it (mirrorItems)

move ​

ts
move(id: number, to: Vec2): void;

Moves one to a place, as a part of the drag's step

moved ​

ts
moved(id: number): string;

What a drag of one is called in the history: "Move gate"

picked ​

ts
picked(): number | undefined;

The one picked, if any: what Escape lets go of, and what the keys turn

placeOf ​

ts
placeOf(id: number): Vec2 | undefined;

Where one stands, by its id: what a drag moves it from

select ​

ts
select(id: number | null): void;

Selects one alone, by its id, or none

turn ​

ts
turn?(id: number, by: number): void;

Turns one by [ and ] (a twelfth of a half turn), where its kind turns that way

turnsNext ​

ts
turnsNext?: boolean;

Whether [ and ] turn the way the next one faces (ToolState.facing) while none is picked