|
NcEngine
|
Interface for higher-level entity and component operations with optional type access restriction. More...
#include <Ecs.h>
Public Types | |
| using | PolicyType = AccessPolicy< Base, Includes... > |
| using | FilterType = typename PolicyType::FilterType |
Public Member Functions | |
| EcsInterface (AccessPolicy< Base, Includes... > policy) noexcept | |
| Construct an EcsInterface instance. | |
|
template<FilterBase TargetBase, class... TargetIncludes> requires PolicyType | |
| ::template ConvertibleTo< TargetBase, TargetIncludes... > | operator EcsInterface< TargetBase, TargetIncludes... > () const noexcept |
| Implicit conversion operator to a more restricted interface. | |
|
template<std::same_as< Entity > T> requires PolicyType | |
| ::template HasAccess< Entity, Transform, Tag, Hierarchy > auto | Emplace (EntityInfo info={}) -> Entity |
| Emplace an entity. | |
|
template<Component T, class... Args> requires PolicyType | |
| ::template HasAccess< T > auto | Emplace (Entity entity, Args &&... args) -> T & |
| Emplace a component. | |
|
template<std::same_as< Entity > T> requires PolicyType | |
| ::template HasAccess< Entity, Transform > auto | Remove (Entity entity) -> bool |
| Remove an entity. | |
|
template<Component T> requires PolicyType | |
| ::template HasAccess< T > auto | Remove (Entity entity) -> bool |
| Remove a component. | |
|
template<Component T> requires PolicyType | |
| ::template HasAccess< T > auto | Get (Entity entity) -> T & |
| Get a component. | |
|
template<Component T> requires PolicyType | |
| ::template HasAccess< T > auto | Get (Entity entity) const -> const T & |
| Get a component. | |
| auto | GetEntityByTag (std::string_view tagValue) -> Entity |
| Get the first Entity matching a Tag. More... | |
|
template<class T > requires PolicyType | |
| ::template HasAccess< T > &&PooledComponent< T > std::same_as< Entity, T > auto | GetPool () const -> decltype(auto) |
| Get the pool for a given type. | |
| template<bool IsRoot> requires PolicyType | |
| auto GetComponentPools() auto | RemoveNode (Entity entity) -> bool |
| Get a range of pointers to all ComponentPoolBase instances. More... | |
Interface for higher-level entity and component operations with optional type access restriction.
| Base | A FilterBase describing the baseline set of types accessible through the interface. |
| Includes | A list of types accessible through the interface in addition to the Base. |
|
inline |
Get the first Entity matching a Tag.
Get a contiguous view of all instances of a type.
Get a contiguous view of all instances of a type.
Get the pool for a given type.
|
inline |
Get a range of pointers to all ComponentPoolBase instances.
Child an Entity to another, or pass Entity::Null() to detach from an existing parent.
Get the root Entity in a hierarchy.
Get the parent entity a component is attached to or Entity::Null().
Check if an entity or component exists.