|
NcEngine
|
Type-agnostic base class for component pools. More...
#include <ComponentPool.h>
Public Types | |
| using | entity_iterator = std::span< const Entity >::iterator |
Public Member Functions | |
| virtual auto | Id () const noexcept -> size_t=0 |
| Get the component's unique id. More... | |
| virtual auto | Contains (Entity entity) const -> bool=0 |
| Check if the pool has a component attached to an entity. More... | |
| virtual auto | GetAsAnyComponent (Entity entity) -> AnyComponent=0 |
| Get the component attached to an entity as an AnyComponent. More... | |
| virtual auto | Remove (Entity entity) -> bool=0 |
| Remove the component attached to an entity. More... | |
| virtual auto | Size () const noexcept -> size_t=0 |
| Get the number of components in the pool, excluding those still staged. More... | |
| virtual auto | StagedSize () const noexcept -> size_t=0 |
| Get the number of staged components waiting to be merged into the pool. More... | |
| virtual auto | TotalSize () const noexcept -> size_t=0 |
| Get the combined number of components in the pool and staged. More... | |
| virtual void | Reserve (size_t capacity)=0 |
| Pre-allocate space for some number of components. More... | |
| virtual auto | GetEntityPool () const noexcept -> std::span< const Entity >=0 |
| Get a span containing the entities with components in the pool. More... | |
| virtual auto | GetComponentName () const noexcept -> std::string_view=0 |
| Get the name from the component's ComponentHandler. More... | |
| virtual auto | HasFactory () const noexcept -> bool=0 |
| Check if the factory callback is set in the component's ComponentHandler. More... | |
| virtual auto | HasUserData () const noexcept -> bool=0 |
| Check if userData is set in the component's ComponentHandler. More... | |
| virtual auto | HasSerialize () const noexcept -> bool=0 |
| Check if the serialize and deserialize callbacks are set in the component's ComponentHandler. More... | |
| virtual auto | HasDrawUI () const noexcept -> bool=0 |
| Check if the drawUI callback set in the the component's ComponentHandler. More... | |
| virtual auto | AddDefault (Entity entity) -> AnyComponent=0 |
| Factory-construct a component attached to an entity. More... | |
| virtual void | Serialize (std::ostream &stream, Entity entity, const SerializationContext &ctx)=0 |
| Serialize the component attached to an entity to a binary stream. More... | |
| virtual void | Deserialize (std::istream &stream, Entity entity, const DeserializationContext &ctx)=0 |
| Deserialize a component from a binary stream and attach it to an entity. More... | |
| virtual void | ClearNonPersistent ()=0 |
| Remove all components not attached to a persistent entity. More... | |
| virtual void | Clear ()=0 |
| Remove all components. More... | |
| virtual void | CommitStagedComponents (const std::vector< Entity > &deleted)=0 |
| Finalize pending changes by merging staged components and removing data for any entities deleted from the ComponentRegistry. More... | |
Public Member Functions inherited from nc::StableAddress | |
| StableAddress (const StableAddress &)=delete | |
| StableAddress (StableAddress &&)=delete | |
| StableAddress & | operator= (const StableAddress &)=delete |
| StableAddress & | operator= (StableAddress &&)=delete |
Type-agnostic base class for component pools.
|
pure virtual |
Factory-construct a component attached to an entity.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Remove all components.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Remove all components not attached to a persistent entity.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Finalize pending changes by merging staged components and removing data for any entities deleted from the ComponentRegistry.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Check if the pool has a component attached to an entity.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Deserialize a component from a binary stream and attach it to an entity.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Get the component attached to an entity as an AnyComponent.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Get the name from the component's ComponentHandler.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Get a span containing the entities with components in the pool.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Check if the drawUI callback set in the the component's ComponentHandler.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Check if the factory callback is set in the component's ComponentHandler.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Check if the serialize and deserialize callbacks are set in the component's ComponentHandler.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Check if userData is set in the component's ComponentHandler.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Get the component's unique id.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Remove the component attached to an entity.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Pre-allocate space for some number of components.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtual |
Serialize the component attached to an entity to a binary stream.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Get the number of components in the pool, excluding those still staged.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Get the number of staged components waiting to be merged into the pool.
Implemented in nc::ecs::ComponentPool< T >.
|
pure virtualnoexcept |
Get the combined number of components in the pool and staged.
Implemented in nc::ecs::ComponentPool< T >.