Class: TraitModelRegistry
Defined in: apps/paracosm/src/engine/trait-models/index.ts:154
In-memory map of TraitModel by id. The runtime singleton lives at
traitModelRegistry; tests and isolated callers can construct
their own via new TraitModelRegistry().
Constructors
Constructor
new TraitModelRegistry():
TraitModelRegistry
Returns
TraitModelRegistry
Methods
get()
get(
modelId):TraitModel|undefined
Defined in: apps/paracosm/src/engine/trait-models/index.ts:173
Return the model or undefined if not registered.
Parameters
modelId
string
Returns
TraitModel | undefined
list()
list():
TraitModel[]
Defined in: apps/paracosm/src/engine/trait-models/index.ts:185
All registered models in registration order.
Returns
register()
register(
model):void
Defined in: apps/paracosm/src/engine/trait-models/index.ts:161
Register a model. Throws if a model with the same id is already registered (registration-time-only; no live re-binding).
Parameters
model
Returns
void
require()
require(
modelId):TraitModel
Defined in: apps/paracosm/src/engine/trait-models/index.ts:178
Return the model or throw UnknownTraitModelError.
Parameters
modelId
string