PlayerPings beta
Class of @v12-engine/client
export declare class PlayerPingsThe player's pings, in code (client.pings, indicators-plan P1): the defs of the kinds there are (GameView.pings.kinds), changed while the game plays, and a ping sent as the player with each kind's audience and cooldown
Members
constructor
constructor(host: PlayerPingsHost, defs?: readonly PingDef[]);Constructs a new instance of the PlayerPings class
canSend
canSend(id: string): boolean;Whether the player may send a kind now: one there is, the rules let go, off its cooldown
cooldownLeft
cooldownLeft(id: string): number;Seconds before the player may send a kind again (its cooldown): 0 when they may now
def
def(id: string): PingDef | undefined;A kind's def, by its id
define
define(def: PingDef): void;Adds a kind, or puts a def in place of the kind's of the same id
defs
get defs(): readonly PingDef[];Every kind there is, in the wheel's order
heard
heard(ping: ShownPing): void;A ping shown: told to what hears them (onPing). The client's, as it shows one
onChange
onChange(listener: () => void): () => void;Told when the kinds change (define, remove): what draws them, the wheel. Gives back the way to stop
onPing
onPing(listener: (ping: ShownPing) => void): () => void;Told of every ping shown on this screen (the player's, an ally's, or anyone's sent to all), with its def, who sent it and its colour: a game's own sound, a tutorial's step, a record. Gives back the way to stop
quick
quick(point: Vec2): boolean;The quick ping (the ping action, the minimap's): the first kind there is, to its audience; the engine's first kind where the game has none
remove
remove(id: string): void;Takes a kind away: not sent, not on the wheel, not drawn
send
send(id: string, point: Vec2, to?: 'allies' | 'all'): boolean;Sends a ping of a kind at a spot as the player, to its audience (PingDef.audience) unless to says otherwise. False where it is not sent: a kind there is not, one the rules do not let go, one on its cooldown