WorldEntity class final

A lightweight handle to an entity inside a specific World. Equality is based on Entity.id; do not compare entities from different worlds.

Inheritance

Properties

alive bool
Whether this entity still has at least one component in world.
no setter
hashCode int
The hash code for this object.
no setterinherited
id int
The value associated with this Entity instance.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
world World
The world this entity belongs to.
final

Methods

despawn() bool
Despawns this entity. Returns true if it was alive.
get<T extends Component>() Option<T>
Reads the component of type T, or None if absent.
has<T extends Component>() bool
Whether this entity has a component of type T.
insert(Component component) WorldEntity
Sets or replaces a component on this entity. Bevy's commands.insert.
insertAll(Iterable<Component> components) WorldEntity
Inserts every component in components.
insertBundle(Bundle bundle) WorldEntity
Inserts every component in bundle.
isDefault() bool
inherited
isNotDefault() bool
inherited
mutate<T extends Component>(T update(T current)) Option<T>
Replaces the component of type T using update.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preferOverDefault(Entity other) Entity
Returns other if this is DefaultEntity, otherwise returns this.
inherited
remove<T extends Component>() Option<T>
Removes the component of type T from this entity.
require<T extends Component>() → T
Reads the component of type T, throwing if absent.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited