struct
ecs::TGroupCommon
template<u32 OwnedTypeCount, u32 IncludedTypeCount, u32 ExcludedTypeCount>Provides helper functionality for owning groups.
Template parameters
OwnedTypeCount | Number of types owned by the group. All owned types will be sorted and tightly packed in their respective storage so they may be quickly iterated over. |
|---|---|
IncludedTypeCount | Number of types in the included type filter. |
ExcludedTypeCount | Number of types in the excluded type filter. |
Public
Methods
~TGroupCommon<OwnedTypeCount, IncludedTypeCount, ExcludedTypeCount>
Size
Returns the number of entities in the group.
OwnsType
Checks if the provided type hash is an element type of one of the owned storage types.
~TGroupCommon<0, IncludedTypeCount, ExcludedTypeCount>
GetGroupStorage
Returns a set of entities that match the group filters.
GetGroupStorage
~GroupCommon
Private
Methods
SwapEntry
Swaps locations of two entities and their associated components in all owned storages.
- packedIndex
- Packed index of the entity to swap from.
- entity
- Entity to swap to.
TryAddEntryToGroupAfterAdd
Checks if the entity passes the group filter, and if so adds the entity to the packed entity list.
This should be called whenever an entity is added to any referenced storage types, so we can check if the entity was added to the included type storage.
TryAddEntryToGroupBeforeRemove
Checks if the entity passes the group filter, and if so adds the entity to the packed entity list.
This should be called whenever an entity is removed from any referenced storage types, so we can check if the entity has been removed from the last excluded storage.
TryRemoveFromGroup
Removes an entity from the list of packed group entities.
TryAddEntryToGroupAfterAdd
Checks if the entity passes the group filter, and if so adds the entity to the packed entity list.
This should be called whenever an entity is added to any referenced storage types, so we can check if the entity was added to the included type storage.
TryAddEntryToGroupBeforeRemove
Checks if the entity passes the group filter, and if so adds the entity to the packed entity list.
This should be called whenever an entity is removed from any referenced storage types, so we can check if the entity has been removed from the last excluded storage.
TryRemoveFromGroup
Removes an entity from the list of packed group entities.