Editor.Model.IEntityPrototypeRegistry
ClassRegistry for entity prototypes, providing methods to create, query, and register entity types within the Editor model.
Index
Properties
Methods
Example
// Resolve IEntityPrototypeRegistry to query registered entity types and captions.
const registry = this.pluginSystem.findInterface(
Editor.Model.IEntityPrototypeRegistry.interfaceId
) as Editor.Model.IEntityPrototypeRegistry;
if (Editor.isNull(registry)) {
console.log('IEntityPrototypeRegistry not available');
return;
}
const types = registry.getEntityTypes('Component', () => true);
console.log('Registered component types:', types.length);
for (const t of types) {
const caption = registry.getCaptionForType(t);
console.log(' Type:', t, 'Caption:', caption);
}
Extends
Properties
interfaceId
staticinterfaceId:InterfaceId
Unique identifier string for the IEntityPrototypeRegistry interface.
Methods
createEntity()
createEntity(
entityType,context,callback):void
Creates a new entity of the specified type within the given context, invoking a callback with the created entity.
Parameters
Returns
void
getCaptionForType()
getCaptionForType(
type):string
Returns the display caption string for the given entity type identifier.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
string
getEntityTypes()
getEntityTypes(
baseType,acceptsType):string[]
Returns an array of entity type strings matching the given base type and acceptance predicate.
Parameters
| Parameter | Type |
|---|---|
baseType | string |
acceptsType | (arg1) => any |
Returns
string[]
getIconForType()
getIconForType(
type):Icon
Returns the icon associated with the given entity type identifier.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
registerEntityPrototype()
registerEntityPrototype(
prototypeData):IGuard
Registers a new entity prototype from the provided prototype data and returns a guard managing the registration lifetime.
Parameters
| Parameter | Type |
|---|---|
prototypeData | EntityPrototypeData |