SetResourceAliasCommand

View source

ExtendsCommand

Represents a deferred request to register a resource alias in a world.

Use this command to map an alias constructor to a resource TypeId without changing the world during construction. Calling SetResourceAliasCommand#execute later delegates to World#setResourceAlias. The alias may be registered before its target resource exists; a later registration with the same alias constructor replaces its target.

Examples

const command = new SetResourceAliasCommand(typeid(Settings), SettingsAlias)
command.execute(world)

Constructor


constructor(id: TypeId, alias: ConstructorFn)

View source

Creates a deferred resource-alias registration command.

The constructor stores the resource ID and alias constructor; it does not register the alias until SetResourceAliasCommand#execute runs.

Parameters

NameDescriptionDefault
id

Type ID of the resource the alias names.

—
alias

Constructor used as the resource alias.

—

Properties


Methods