IEventHandler

interface IEventHandler

Interface representing an event handler.

Functions

Link copied to clipboard
Returns the list of child event handlers.
Link copied to clipboard
open fun handleEvents(): Boolean
Handles events for this handler.
Link copied to clipboard
inline fun <T : Event> IEventHandler.handler(noinline condition: () -> Boolean = { true }, ignoresCondition: Boolean = false, priority: Priority = Priority.NORMAL, timeout: Long? = null, noinline handler: (T) -> Unit)

Registers an event handler for a specific event type.

Link copied to clipboard
abstract fun initHandlers()
Please write a handler initialization code.
Link copied to clipboard
open fun parent(): IEventHandler
Returns the parent event handler.
Link copied to clipboard
inline fun <T : ReturnableEvent<R>, R> IEventHandler.returnableHandler(noinline condition: () -> Boolean = { true }, ignoresCondition: Boolean = false, priority: Priority = Priority.NORMAL, timeout: Long? = null, noinline returnableHandler: (T) -> R)

Registers a returnable event handler for a specific event type.

Link copied to clipboard
open fun unregister()
Unregisters this event handler and all its children.