Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
It is possible to add an object that will be included in the callback to avoid creating too many closures.
Calling twice addEventListener with the same parameters results in the second call to be ignored,
only unique pairs callback / object are allowed, in order to avoid calling multiple times the same
thing.
The id of the inserted callback (actually an UUID).
Adds a listener to an event type.
When an event of the type pType fires, the callback pListener will be called. This function
returns a unique string id that may be used in removeEventListenerById to allow simple
listener removal.
The id of the inserted callback (actually an UUID).
Tells if the EventDispatcher has such a callback registered for the given event type.
true if such a listener is installed for the given type of event.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
The listener object that was used when addEventListener was called.
true if the callback was removed else false.
Removes a listener from an event type.
If no such listener is found, then the function returns false and does nothing. You must use the exact parameters that were used in addEventListener to actually remove the listener.
The listener function that gets removed.
true if the callback was removed else false.
Removes a listener by its id.
If no such listener is found, then the function returns false and does nothing. You must use the return value of addEventListener to actually remove the listener.
true if the callback was removed else false.
The EventDispatcherInterface interface is the 3djuump Infinite API implementation of the observer pattern, very similar to the DOM event system of javascript.
Objects implementing this interface can install/remove listeners to be notified when some events fire with the use of the addEventListener and removeEventListener functions.
The syntax is very close to the DOM addEventlistener functions.