Skip to content

PreviewWorld beta ​

Class of @v12-engine/editor

ts
export declare class PreviewWorld

The world the cinematic preview runs (see the top of this file)

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the PreviewWorld class.

Members ​

advance ​

ts
advance(seconds: number): boolean;

Moves the world on by seconds of the cinematic's screen, at its pace: the ticks that fall in them run, and what they changed is drawn (host.show). Whether a tick ran

checkpoint ​

ts
checkpoint(at: number): void;

Saves the world as it stands, at a moment of the cinematic's clock, to run on from after a scrub

cutWorld ​

ts
get cutWorld(): CutWorld;

What the cinematic's waits read of it: the snapshots as drawn, and the seat's sight (the whole map)

direct ​

ts
direct(command: Record<string, unknown>): void;

Sends a director's command for a cinematic; held still, the world goes on a tick so that it lands at once

directs ​

ts
directs(): boolean;

Whether the game takes a director's commands (directorPack)

dispose ​

ts
dispose(): void;

Puts the world away, its checkpoints with it: the preview is stopped, or taken off. Another is made as one is next wanted

forget ​

ts
forget(): void;

The map or the game changed: the world is one of another map now, and is made anew (from the start, with no checkpoint kept) as it is next wanted (ready)

holds ​

ts
holds: number;

How many cinematics hold the world still (PlayOptions.hold): it moves on a tick only for a command (direct)

load ​

ts
load(checkpoint: PreviewCheckpoint): Promise<boolean>;

The world as a checkpoint had it, to run on from

make ​

ts
make(): Promise<boolean>;

A world of the map as it is now, from its start, made anew as Play here makes its game (the one there was goes). Whether there is one: a map that cannot be played (said once) has none, and the preview plays with no world

named ​

ts
named(name: string): number | undefined;

The world's own id of a unit by the name the map or the cinematic gave it, as it is drawn now

ts
get nav(): Navigation | undefined;

The navigation of the world made (make), to read: none before

nearest ​

ts
nearest(at: number, usable?: (time: number) => boolean): PreviewCheckpoint | undefined;

The latest checkpoint at or before a moment of the clock that usable takes, or none: the start

playerId ​

ts
get playerId(): PlayerId | undefined;

The seat the world is played from

rate ​

ts
rate: number;

The world's seconds for every second of the cinematic's screen: 1, or slow motion's (StageTime.rate); nothing moves at 0

ready ​

ts
get ready(): boolean;

Whether a world runs: made, and not to be made anew

refresh ​

ts
refresh(): void;

Draws the world as it stands now (host.show): as it is first shown on the stage, and again after a load

runsHeld ​

ts
runsHeld: boolean;

Whether it runs on while held (StageTime.rate's run)

send ​

ts
send(command: PlayerCommand): void;

Sends a command as the seat's player: the cinematic's orders

tickRate ​

ts
get tickRate(): number;

Ticks a second of the world's

untilTick ​

ts
untilTick(): number;

Seconds of the cinematic's screen until its next tick, at its pace: what the preview steps the cinematic by, so that an order sent in the step lands on that tick. None where it stands still