ECS
All low-level functionality for creating and using the entity component system.
Classes
-
ecs::TSparseSet— Implements features of SparseSet that depend on a particular deletion policy. -
ecs::TComponentSparseSet— Storage used for storing components associated with entities. -
ecs::EntitySparseSet— Storage used for storing only entities. -
ecs::TGroup— Non-owning group specialization. -
ecs::IECSEntityOwner— Interface for objects that own an ECS entity. -
ecs::TTagSparseSet— Storage used for storing tags associated with entities. -
ecs::TView— Creates a view that allows you to iterate over all entities that match included & excluded type filter. -
ecs::Registry— Stores all entities and components in their respective storages. -
ecs::RuntimeView— Creates a view that allows you to iterate over all entities that match included & excluded type filter.
Structs
-
ecs::TEntity— Represents a single entity in the ECS system. -
ecs::NullEntity— Helper structure that represents a null Entity. -
ecs::InvalidEntity— Helper structure that represents an invalid (usually deleted) Entity. -
ecs::StorageForType
Enums
-
ecs::SparseSetDeletePolicy— Determines how are entries treated when they are removed from a sparse set.
Internal
Symbols intended for engine-internal use. Not part of the public API.
Classes
-
ecs::SparseSet— Similar to an array, but saves memory by not allocating data if there are large gaps in the stored indices. i.e. while a regular array would require you to allocate an array of size 100 000 to store an entry at index 99 999, sparse set will only allocate a single page of data. -
ecs::TMultiStorageViewCommon— Provides helper functionality for a view containing multiple (more than one) included or excluded types. -
ecs::TSingleStorageViewCommon— Provides helper functionality for a view containing single include types, and no excluded types.
Structs
-
ecs::TEntityTypeTraits -
ecs::TPointerToTemporary— Moves a temporary value into the structure so may be passed around and accessed as if it was a pointer. -
ecs::TIteratorRange— Contains a range between two iterators that can be iterated using a ranged for loop. -
ecs::TMultiIteratorAdapter— Performs iteration at multiple underlying iterators at once. -
ecs::TInheritConstFromHelper— Returns T as either 'T' or 'const T' depending if is const or not. -
ecs::TIncludedTypes— Helper type that can be used for providing a list of types to be included in view or group. -
ecs::TExcludedTypes— Helper type that can be used for providing a list of types to be excluded from view or group. -
ecs::TOwnedTypes— Helper type that can be used for providing a list of types owned by a group. -
ecs::TIsInvocableWithTupleArgumentsHelper -
ecs::TContiguousContainerIterator— Iterator that allows iteration over a container whose contents are contiguous in memory. -
ecs::TPagedContainerIterator— Allows iteration over an array that is split over multiple pages of equal size. -
ecs::TagGroup— Compile-time grouping of related ECS tag types for serialization. -
ecs::IsTagGroup— Type trait to detect TagGroup specializations at compile time. -
ecs::TGroupIteratorAdapter— Adapter around the provided iterator type that allows range for iteration. -
ecs::GroupCommon— Common interface for all TGroup specializations. -
ecs::TGroupCommon— Provides helper functionality for owning groups. -
ecs::TViewIterator— Iterator that iterates over all entities that match the view included & excluded type filter. -
ecs::TViewIteratorAdapter— Adapter around TViewIterator that allows range for iteration. -
ecs::RuntimeViewIterator— Iterator that iterates over all entities that match the runtime view included & excluded type filter.
Free functions
GetAsTuple
constexpr auto GetAsTuple(StorageType *storage, Entity entity)
Returns an entry from ECS storage as a tuple containing a single element.
If the entity has no associated data (e.g. if storage contains tags), returns an empty tuple.
IsEntityPartOfAll
static bool IsEntityPartOfAll(It first, It last, Entity entity)
Checks if the entity is part of all storages in the provided range.
IsEntityPartOfAny
static bool IsEntityPartOfAny(It first, It last, Entity entity)
Checks if the entity is part of any storages in the provided range.
DoesEntityMatchFilter
static bool DoesEntityMatchFilter(Entity entity, const std::array<const SparseSet *, IncludedTypeCount> &includedTypeStorage, const std::array<const SparseSet *, ExcludedTypeCount> &excludedTypeStorage, u32 leadingTypeIndex)
Checks if entity matches the included & excluded type filters.
Template parameters
IncludedTypeCount | Number of types in the included type filter. |
|---|---|
ExcludedTypeCount | Number of types in the excluded type filter. |
StorageMayContainInvalidEntities | True if the storage may contain invalid entities (i.e. storage is using in-place delete). |
- entity
- Entity to check.
- includedTypeStorage
- Storages that must contain the entity to pass the filter.
- excludedTypeStorage
- Storages that must not contain the entity to pass the filter.
- leadingTypeIndex
- Index of the included type storage which is leading, and therefore guaranteed to contain the entity.