Module entity_store

Module entity_store 

Source
Expand description

The EntityStore maintains all registered entities in the form of EntityRecords, EntityRecords track the count of the instances of the Entity (valid EntityId<Entity> values) and owns the PropertyStore<E>, which manages the entity’s properties.

Although each Entity type may own its own data, client code cannot create or destructure EntityId<Entity> values directly. Instead, EntityStore centrally manages entity counts for all registered types so that only valid (existing) EntityId<E> values are ever created.

Structs§

EntityRecord
We store our own instance data alongside the Entity instance itself.
EntityStore
A wrapper around a vector of entities.

Functions§

add_to_entity_registry
Adds a new entity to the registry. The job of this method is to create whatever “singleton” data/metadata is associated with the Entity if it doesn’t already exist, which in this case is only the value of Entity::id().
get_entity_metadata_static
Returns the pre-computed, frozen metadata for an entity type.
get_registered_entity_count
A convenience getter for NEXT_ENTITY_INDEX.
initialize_entity_index
Encapsulates the synchronization logic for initializing an entity’s index.
register_property_with_entity
The public setter interface to ENTITY_METADATA.