API Reference › Reflect › Reflect.model
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 name

Example

program Demo {
  property Health { hp: int = 0 }
  model Unit { Health }
  entry {
    print(Reflect.model("Unit"))
  }
}
← All symbols