Package dev.prozilla.pine.common.event
Interface EventDispatcherProvider<EventType extends Enum<EventType>,Target,E extends Event<EventType,Target>>
- All Superinterfaces:
EventDispatcherContext<EventType,
Target, E>
- All Known Implementing Classes:
Node
@ProviderOf(EventDispatcher.class)
public interface EventDispatcherProvider<EventType extends Enum<EventType>,Target,E extends Event<EventType,Target>>
extends EventDispatcherContext<EventType,Target,E>
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.prozilla.pine.common.event.EventDispatcherContext
EventDispatcherContext.EphemeralEventListener<EventType extends Enum<EventType>,
E extends Event<EventType, ?>> -
Method Summary
Modifier and TypeMethodDescriptiondefault EventListener
<E> addListener
(EventType eventType, EventListener<E> listener) Adds a listener that listens to a given type of event.default void
Invokes the event of a given type with a given target.default void
removeListener
(EventType eventType, EventListener<E> listener) Removes a listener that was listening to a given type of event.Methods inherited from interface dev.prozilla.pine.common.event.EventDispatcherContext
addListener, addTargetedListener, off, on, once
-
Method Details
-
getEventDispatcher
EventDispatcher<EventType,Target, getEventDispatcher()E> -
addListener
Description copied from interface:EventDispatcherContext
Adds a listener that listens to a given type of event.Unicity is not required. If a listener is added multiple times, it will be called multiple times per event.
- Specified by:
addListener
in interfaceEventDispatcherContext<EventType extends Enum<EventType>,
Target, E extends Event<EventType, Target>> - Parameters:
eventType
- The type of event to listen tolistener
- The listener to add- Returns:
- The listener that was added.
-
removeListener
Description copied from interface:EventDispatcherContext
Removes a listener that was listening to a given type of event.- Specified by:
removeListener
in interfaceEventDispatcherContext<EventType extends Enum<EventType>,
Target, E extends Event<EventType, Target>> - Parameters:
eventType
- The type of event that was being listened tolistener
- The listener to remove
-
invoke
Description copied from interface:EventDispatcherContext
Invokes the event of a given type with a given target.
-