pub type EntityIdLocation = Option<EntityLocation>;
Expand description
An Entity
id may or may not correspond to a valid conceptual entity.
If it does, the conceptual entity may or may not have a location.
If it has no location, the EntityLocation
will be None
.
An location of None
means the entity effectively does not exist; it has an id, but is not participating in the ECS.
This is different from a location in the empty archetype, which is participating (queryable, etc) but just happens to have no components.
Setting a location to None
is often helpful when you want to destruct an entity or yank it from the ECS without allowing another system to reuse the id for something else.
It is also useful for reserving an id; commands will often allocate an Entity
but not provide it a location until the command is applied.
Aliased Type§
pub enum EntityIdLocation {
None,
Some(EntityLocation),
}