method
Reflect.has
Reflect.has(entity, prop) -> bool
Returns whether entity carries property prop. A generic walker checks it before reading a component's fields, so it visits only the components an entity actually has.
Example
program Demo {
property Health { hp: int = 0 }
model Unit { Health }
entry {
spawn Unit { Health { hp: 7 } }
if Reflect.has(0, Reflect.prop("Health")) { print(1) }
}
}