EventManager

A modern and fast event handler using lambda handlers

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun <T : Event> callEvent(event: T): T

Call event to listeners

Link copied to clipboard

Looks up by Tag name, ignoring case.

Link copied to clipboard
fun <T : Event> eventFlow(eventClass: Class<T>): SharedFlow<T>

Gets a SharedFlow for the given event class. The flow receives the event instances after all EventHooks are executed. So the Event.isCompleted will be true when the event is emitted.

Link copied to clipboard
Link copied to clipboard
fun <T : Event> registerEventHook(eventClass: Class<out Event>, eventHook: EventHook<T>): EventHook<T>

Used by handler methods

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : Event> unregisterEventHook(eventClass: Class<out Event>, eventHook: EventHook<T>)

Unregisters a handler.