Skip to content

Sequences beta ​

Class of @v12-engine/engine

ts
export declare class Sequences

The sequences of a world

Members ​

constructor ​

ts
constructor(world: World, defs: readonly SequenceDef[]);

Constructs a new instance of the Sequences class

heard ​

ts
heard(event: string, payload: unknown): void;

An event that sequences may wait for went off. For the engine's listeners

hurry ​

ts
hurry(id: number): boolean;

Cuts the wait a sequence is on short, and takes it on at once: a line of dialog skipped. Whether it was waiting

listenersFor ​

ts
static listenersFor(defs: readonly SequenceDef[]): ListenerDef[];

Listeners for the events the sequences of a game wait for, one for each event: the world subscribes them with the game's own

resume ​

ts
resume(id: number): void;

Takes a sequence whose wait is over on. For the engine's timer

running ​

ts
running(id: number): boolean;

Whether a sequence is still running

start ​

ts
start<D>(sequence: SequenceDef<D>, ...data: D extends undefined ? [] : [D]): number;

Starts a sequence: its first steps run at once, up to the first that waits. Returns its id, for stop

stop ​

ts
stop(id: number): boolean;

Stops a sequence where it is. Whether it was running

update ​

ts
update(): void;

Asks the sequences waiting until something holds whether it does. The sequences system does, every tick