EndingsController beta
Interface of @v12-engine/client
export interface EndingsControllerGiving 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
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
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
readonly online: boolean;Whether the game is played on a server, where a player may pause it for everyone
pause
pause(): void;Asks the server to pause the game for everyone
paused
readonly paused: Accessor<ServerPause | null>;The pause on now, or null when there is none
pausesLeft
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
resume(): void;Asks the server to end the pause
surrender
surrender(): void;Gives up: the player is defeated; the rules may refuse (beforeSurrender)