class Nya::Event
- Nya::Event
- Reference
- Object
Overview
Base class for events
Direct Known Subclasses
Defined in:
nya/event.crClass Method Summary
-
.send(name, event : Event)
Fire an event.
-
.send_async(name, e : Event)
Send an event that will be triggered from update fiber
-
.subscribe(*events, handler)
Subscribe handler to event types (
events
) -
.subscribe(*events, &handler : Event -> )
Subscribe proc to event types
-
.unsubscribe(handler : EventHandler)
Unsubscribe handler
-
.unsubscribe(id : Int64)
Unsubscribe handler by
ID
Instance Method Summary
-
#status : Nya::EventStatus
Status of event
-
#status=(status : Nya::EventStatus)
Status of event
Macro Summary
-
subscribe_typed(*args, as t, &proc)
Helper macro to automatically cast event passed to handler
Class Method Detail
Fire an event. Calls #send_async if called not from engine main fiber
Send an event that will be triggered from update fiber
Instance Method Detail
Macro Detail
macro subscribe_typed(*args, as t, &proc)
#
Helper macro to automatically cast event passed to handler