TEventQueue
Index
Constructors
Methods
Constructors
constructor
Parameters
relayTo: MessagePort[] = []
workers to rely all events to
childQueues: IChildEventQueue[] = []
Returns default
Methods
publicaddListener
Add event listener for the given event type with optional sub type.
Type parameters
- T: TEvent
Parameters
type: string
func: (event: T) => void
Returns void
publicbroadcast
Adds the event to the event queue, ready to be processed.
Parameters
event: TEvent
optionaldontRelay: boolean
Returns void
publicremoveListener
Removes listener using the given id and function.
Type parameters
- T: TEvent
Parameters
type: string
func: (event: T) => void
Returns void
publicupdate
Returns void
Processes all event handling across the game.
You can provide Web Workers to the constructor to relay any events this queue receives.