CommandsInstance
Defined in: ecs/commands.ts:187
The command queue a system declared with Commands. Records structural work — spawn, despawn, add or remove a component, install a resource — and applies it when the system returns, so nothing moves under a running query.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new CommandsInstance(
world,resources):CommandsInstance
Defined in: ecs/commands.ts:193
Parameters
Section titled “Parameters”resources
Section titled “resources”ResourceStorage
Returns
Section titled “Returns”CommandsInstance
Methods
Section titled “Methods”despawn()
Section titled “despawn()”despawn(
entity):this
Defined in: ecs/commands.ts:208
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”this
entity()
Section titled “entity()”entity(
entity):EntityCommands
Defined in: ecs/commands.ts:204
Parameters
Section titled “Parameters”entity
Section titled “entity”number
Returns
Section titled “Returns”flush()
Section titled “flush()”flush():
void
Defined in: ecs/commands.ts:254
Returns
Section titled “Returns”void
insertResource()
Section titled “insertResource()”insertResource<
T>(resource,value):this
Defined in: ecs/commands.ts:213
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”resource
Section titled “resource”ResourceDef<T>
T
Returns
Section titled “Returns”this
queueInsert()
Section titled “queueInsert()”queueInsert(
entity,component,data):void
Defined in: ecs/commands.ts:222
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”unknown
Returns
Section titled “Returns”void
queueRemove()
Section titled “queueRemove()”queueRemove(
entity,component):void
Defined in: ecs/commands.ts:226
Parameters
Section titled “Parameters”entity
Section titled “entity”number
component
Section titled “component”Returns
Section titled “Returns”void
queueSetParent()
Section titled “queueSetParent()”queueSetParent(
entity,parent):void
Defined in: ecs/commands.ts:230
Parameters
Section titled “Parameters”entity
Section titled “entity”number
parent
Section titled “parent”number
Returns
Section titled “Returns”void
spawn()
Section titled “spawn()”spawn(
name?):EntityCommands
Defined in: ecs/commands.ts:198
Parameters
Section titled “Parameters”string