Skip to content

ViewFile beta ​

Interface of @v12-engine/client

ts
export interface ViewFile<T>

A file of the game's laid over fields of its view (GameView): what it is called, how it is read (checked, throwing on what is wrong, with where) and written, which fields it is laid over and how, and how a world drawing it and a game playing it take it as it changes

Members ​

fields ​

ts
readonly fields: readonly (keyof GameView)[];

The fields of the view the file is laid over

game ​

ts
game?(client: GameClientApi, view: GameView, before: Partial<GameView> | undefined): void;

What a game being played does besides its world: its HUD, its floats, its pings, its quality

lay ​

ts
lay(code: Partial<GameView>, file: T): Partial<GameView>;

Those fields as the code says them with the file laid over them: new values, the code's own left as they were

name ​

ts
readonly name: string;

The file's name in the game's folder: hud.json

read ​

ts
read(data: unknown): T;

The file as data, checked: throws on what is wrong, saying where

text ​

ts
text(file: T): string;

The file as it is written: tidy, a field a line

world ​

ts
world?(world: ViewFileWorld, view: GameView, before: Partial<GameView> | undefined, environment: MapEnvironment): void;

What a world drawing the view does as the file is laid again (before: the fields as they were; none when it is taken whole, as a game starts): draws the effects, the layers' looks... environment is what the map says of its looks now