NcEngine
|
Single pool storing all FreeComponent instances. More...
#include <FreeComponentPool.h>
Public Member Functions | |
FreeComponentPool (size_t maxEntities) | |
template<std::derived_from< FreeComponent > T, class ... Args> | |
auto | Emplace (Entity entity, Args &&... args) -> T & |
Construct an instance of T and attach it to an Entity. | |
template<std::derived_from< FreeComponent > T> | |
auto | Remove (Entity entity) -> bool |
Remove the instance of T from an Entity. | |
template<std::derived_from< FreeComponent > T> | |
bool | Contains (Entity entity) const noexcept |
Check if there is an instance of T attached to an Entity. | |
template<std::derived_from< FreeComponent > T> | |
auto | Get (Entity entity) const -> T & |
Get the instance of T attached to an Entity. | |
void | CommitStagedComponents (std::span< const Entity > removedEntities) |
Finalize any staged additions and removals. | |
void | ClearNonPersistent () noexcept |
Remove all components not attached to persistent Entities. | |
void | Clear () noexcept |
Remove all components. | |
Single pool storing all FreeComponent instances.