Skip to content

EndingsController beta ​

Interface of @v12-engine/client

ts
export interface EndingsController

Giving up and pausing, in a game (client.endings): whether the player may give up (canSurrender) and does (surrender); in a game on a server, how many pauses they have left (pausesLeft), whether they may ask for one (canPause) and do (pause), the pause on now (paused, by whom and until when) and ending it (resume). The pause menu's lines (Give up, Pause the game, Let the game go on) and the HUD's part paused are drawn from it. What the rules allow is theirs to say (beforeSurrender, beforePause, RuleSettings.talk.pauses.each): this is what the player asks

Members ​

canPause ​

ts
canPause(): boolean;

Whether the player may ask for a pause now: in a game on a server, with a pause left and none on

canSurrender ​

ts
canSurrender(): boolean;

Whether the player may give up now: in the game, not only watching, not out of it, and the game not over

online ​

ts
readonly online: boolean;

Whether the game is played on a server, where a player may pause it for everyone

pause ​

ts
pause(): void;

Asks the server to pause the game for everyone

paused ​

ts
readonly paused: Accessor<ServerPause | null>;

The pause on now, or null when there is none

pausesLeft ​

ts
readonly pausesLeft: Accessor<number>;

How many pauses the player has left in a game on a server (RuleSettings.talk.pauses.each at the start)

resume ​

ts
resume(): void;

Asks the server to end the pause

surrender ​

ts
surrender(): void;

Gives up: the player is defeated; the rules may refuse (beforeSurrender)