constructor(resource: object)
View sourceCreates a deferred resource-installation command.
The constructor stores the resource only; it does not call
World#setResource until AddResourceCommand#execute runs.
Class
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.
const command = new AddResourceCommand(new Settings())
command.execute(world)constructor(resource: object)Creates a deferred resource-installation command.
The constructor stores the resource only; it does not call
World#setResource until AddResourceCommand#execute runs.
Resource instance to install when AddResourceCommand#execute
runs.
execute(world: World): voidApplies this command’s deferred resource installation to a world.
Passes AddResourceCommand#resource to
World#setResource.