Skip to content

on_self_event

fun <reified E : DomainEvent> on_self_event(behaviour: E.(self: Entity) -> Unit)
E.(self: Entity) -> Unit

Entity

Works with: Entity

Example
node<Npc>()
on_self_event<ProjectileHit> { npc ->
npc.speak("Ouch!")
}
var producedOn: Int