ID unique to this entity.
Constructs a new Entity
and adds the given components to it.
The components to add.
The world to add the entity to, defaults to defaultWorld
.
Adds one or more components to the entity.
The components to add.
Adds a component to the entity using value
as the initial value.
The component to add.
Initial value of the added component.
Removes one or more given components from the entity.
The components to remove.
Checks whether a given component exists on the entity.
The component to check for.
true
if the component exists, false
otherwise.
Returns the readonly value of a given component.
The component to get the value of.
The readonly value.
Returns the mutable value of a given component.
The component to get the value of.
The mutable value.
Returns a readonly map of all component values present on the entity.
A readonly map of all component values.
Registers a given callback to be run upon mutation to given component.
The component to observe.
The callback to run on mutation.
A removal callback, that, if run, removes the mutation observer.
Registers a given callback to be run upon mutation to given component.
A removal callback, that, if run, removes the mutation observer.
Removes a mutation observer.
The component being observed.
The callback to remove.
Returns whether Entity.destroy
has been called on the entity.
true
if the entity was destroyed, false
otherwise.
Destorys the entity, removing all components.
Generated using TypeDoc
The Entity representation, which can carry mulitple components and appear in
Query
s.