AddResourceCommand

View source

ExtendsCommand

Represents a deferred request to install a resource in a world.

Use this command when a resource should be installed as part of a deferred world update. Constructing it stores the resource without changing the world. Calling AddResourceCommand#execute later delegates to World#setResource. A resource already stored under the same constructor type ID is replaced by the new instance.

Examples

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

Constructor


Properties


Methods