method
Reflect.model
Reflect.model(name) -> int
Resolves a model (archetype) name to its id, or -1 if no such model exists. The counterpart to Reflect.kind: resolve the name once, then compare entities' kinds against it.
Parameters
namethe model nameExample
program Demo {
property Health { hp: int = 0 }
model Unit { Health }
entry {
print(Reflect.model("Unit"))
}
}