Namespace: game

game

Methods

(static) all(f) → {string}

Adds a listener that's called whenever the client recieves an event of any kind.
Parameters:
Name Type Description
f function A function that's called whenever an event is recieved.
Source:
Returns:
The resulting ID of the listener.
Type
string

(static) on(event, f) → {string}

Adds a listener that's called whenever the client recieves a specific event.
Parameters:
Name Type Description
event string The event that should trigger the function.
f function A function that's called whenever the specified event is recieved.
Source:
Returns:
The resulting ID of the listener.
Type
string

(static) once(event, f) → {string}

Adds a listener that's called just once whenever the client recieves a specific event.
Parameters:
Name Type Description
event string The event that should trigger the function.
f function A function that's called whenever the specified event is recieved.
Source:
Returns:
The resulting ID of the listener.
Type
string

(static) remove(id)

Removes a listener from the listeners array.
Parameters:
Name Type Description
id string The ID of the listener to remove.
Source:

(static) trigger(event, …args)

Triggers a specified event, triggering any related listeners.
Parameters:
Name Type Attributes Description
event string The event to trigger.
args * <repeatable>
The arguments to pass to the related listeners.
Source: