public interface IEventManager
| Modifier and Type | Method and Description |
|---|---|
<T extends Event> |
callEvent(T event)
Call an event and forward it to all
IEventListeners registered
on this event manager. |
<T extends Event> |
registerListener(EventKey eventKey,
IEventListener<T> eventListener)
Registers a new listener that will be called on matching events.
|
<T extends Event> |
registerListeners(EventKey eventKey,
IEventListener<T>... eventListeners)
Registers multiple event listeners at once.
|
void |
unregisterListener(Class<? extends Event> eventClass)
Removes all event listeners for a specific event class.
|
void |
unregisterListener(EventKey eventKey)
Removes all listener from a specific
EventKey from this event manager. |
void |
unregisterListener(IEventListener<?> eventListener)
Removes an event listener from all
EventEntitys. |
<T extends Event> void registerListener(EventKey eventKey, IEventListener<T> eventListener)
T - the type of the events to have the event listener be called oneventKey - the domain of the event listenereventListener - the actual event listener instance that will be called uponregisterListeners(EventKey, IEventListener[])<T extends Event> void registerListeners(EventKey eventKey, IEventListener<T>... eventListeners)
T - the type of the events to have the event listeners be called oneventKey - the domain of the event listenerseventListeners - the event listener instances that will be called uponregisterListener(EventKey, IEventListener)void unregisterListener(EventKey eventKey)
EventKey from this event manager.eventKey - the domain of the event listeners that will be removedvoid unregisterListener(IEventListener<?> eventListener)
EventEntitys.eventListener - the event listener to removevoid unregisterListener(Class<? extends Event> eventClass)
eventClass - the class that should have all its event listeners removed<T extends Event> boolean callEvent(T event)
IEventListeners registered
on this event manager.T - the type of the event and IEventListener to callevent - the event to calltrue when no IEventListener was called,
false otherwiseCopyright © 2020. All rights reserved.