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§
- Entity
Record - We store our own instance data alongside the
Entityinstance itself. - Entity
Store - 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
Entityif it doesn’t already exist, which in this case is only the value ofEntity::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.