RemoveResourceCommand

View source

ExtendsCommand

Builds a deferred request to remove one resource from a world.

The command stores the resource constructor without looking up or changing the world. RemoveResourceCommand#execute delegates to World#removeResource. The world removes the resource and alias entry keyed by that constructor’s type ID; aliases under other keys remain, even if they point to the removed resource.

Examples

const command = new RemoveResourceCommand(Settings)
command.execute(world)

Constructor


constructor(resourceType: ConstructorFn)

View source

Creates a command with a resource constructor as its payload.

The constructor stores the type only. It does not remove a resource until RemoveResourceCommand#execute runs.

Parameters

NameDescriptionDefault
resourceType

Constructor of the resource to remove.

—

Properties


Methods