Every class which inherits from the EventDispatcher class has the ability to dispatch and listen to events. When the class dispatches an event, every EventDispatcher listening to this class will receive that event.
- Author
- Ramses Di Perna
◆ addEventListener()
void com.mygdx.game.engine.events.EventDispatcher.addEventListener |
( |
String |
type, |
|
|
IEventReceiver |
listeningClass |
|
) |
| |
Adds an event listener to this EventDispatcher. NOTE: You must call the method 'removeEventListener' to remove the listen from the EventDispatcher
- Parameters
-
type | of message to listen to. |
listeningClass | is the one which should be triggered on the event. |
◆ clean()
void com.mygdx.game.engine.events.EventDispatcher.clean |
( |
| ) |
|
◆ destroyAllListeners()
void com.mygdx.game.engine.events.EventDispatcher.destroyAllListeners |
( |
| ) |
|
◆ dispatchEvent()
void com.mygdx.game.engine.events.EventDispatcher.dispatchEvent |
( |
Event |
event | ) |
|
This dispatches an event which will trigger the effect for all who listen to the type.
- Parameters
-
◆ getAllListeners()
ArrayList<ListenerItem> com.mygdx.game.engine.events.EventDispatcher.getAllListeners |
( |
| ) |
|
Returns all who listen to this dispatcher.
- Returns
- list of listeners.
◆ hasEventListener()
boolean com.mygdx.game.engine.events.EventDispatcher.hasEventListener |
( |
String |
type | ) |
|
This method returns whether the given type of message already has a listener.
- Parameters
-
- Returns
- whether the message is being listened to. 'True' if so else 'False'.
◆ removeEventListener()
void com.mygdx.game.engine.events.EventDispatcher.removeEventListener |
( |
String |
type, |
|
|
IEventReceiver |
listener |
|
) |
| |
Removes the event which the was being listened to by the caller.
- Parameters
-
type | of message to remove the listener from |
listener | is the given class at the listening request which should be triggered on the event. |
The documentation for this class was generated from the following file:
- C:/Users/RamsesPC/Documents/LibGDXGames/PvB/core/src/com/mygdx/game/engine/events/EventDispatcher.java