Skip to main content

Class: TEventQueue

Defined in: core/event-queue.ts:19

Processes all event handling across the game.

You can provide Web Workers to the constructor to relay any events this queue receives.

Constructors​

Constructor​

new TEventQueue(relayTo?, childQueues?): TEventQueue

Defined in: core/event-queue.ts:29

Parameters​

relayTo?​

MessagePort[] = []

workers to rely all events to

childQueues?​

IChildEventQueue[] = []

Returns​

TEventQueue

Methods​

addListener()​

Call Signature​

addListener<T>(type, func): void

Defined in: core/event-queue.ts:63

Add event listener for the given event type with optional sub type.

Type Parameters​
T​

T extends TEvent

Parameters​
type​

string

func​

(event) => void

Returns​

void

Call Signature​

addListener<T>(type, subType, func): void

Defined in: core/event-queue.ts:67

Add event listener for the given event type with optional sub type.

Type Parameters​
T​

T extends TEvent

Parameters​
type​

string

subType​

string

func​

(event) => void

Returns​

void


broadcast()​

broadcast(event, dontRelay?): void

Defined in: core/event-queue.ts:39

Adds the event to the event queue, ready to be processed.

Parameters​

event​

TEvent

dontRelay?​

boolean

Returns​

void


removeListener()​

Call Signature​

removeListener<T>(type, func): void

Defined in: core/event-queue.ts:102

Removes listener using the given id and function.

Type Parameters​
T​

T extends TEvent

Parameters​
type​

string

func​

(event) => void

Returns​

void

Call Signature​

removeListener<T>(type, subType, func): void

Defined in: core/event-queue.ts:106

Removes listener using the given id and function.

Type Parameters​
T​

T extends TEvent

Parameters​
type​

string

subType​

string

func​

(event) => void

Returns​

void


update()​

update(): void

Defined in: core/event-queue.ts:138

Returns​

void