method
Reflect.kind
Reflect.kind(entity) -> int
Returns the model (archetype) id of entity — which kind of thing it is. Compare it against Reflect.model to branch on an entity's type, or use it to label a save record. Same as World.kind, under the reflection namespace.
Parameters
entitythe entity to identifyExample
program Demo {
property Health { hp: int = 0 }
model Unit { Health }
entry {
spawn Unit { Health { hp: 7 } }
if Reflect.kind(0) == Reflect.model("Unit") { print(1) }
}
}