-
Notifications
You must be signed in to change notification settings - Fork 21
Events
Greg edited this page Jan 26, 2022
·
6 revisions
entity.events.emit(Event(data))
// Global scope
on<Entity, Event>({ condition && isMet }, Priority.HIGH) {
}
// Local scope
val listener = entity.events.on<Entity, Event>({ condition && isMet }, Priority.HIGH) {
}
// Important to remove listeners in local scope to prevent leaking memory
entity.events.remove(listener)