14 using namespace FECS::Manager;
40 return m_EntityManager.Create();
56 m_EntityManager.Destroy(
id);
66 return m_EntityManager.IsAlive(
id);
75 return m_EntityManager;
107 template <
typename T>
120 template <
typename T>
137 template <
typename T>
150 template <
typename T>
166 template <
typename T>
179 template <
typename... C>
SparseSet stores components in a densely packed array while allowing fast indexed lookup via sparse i...
Definition sparse_set.h:62
bool Has(Entity e) const
Checks if the entity has a component.
Definition sparse_set.h:127
virtual void Remove(Entity e) override
Removes the component associated with an entity.
Definition sparse_set.h:98
void Insert(Entity e, const T &component)
Inserts or overrides a component for an entity,.
Definition sparse_set.h:73
T & Get(Entity e)
Returns a mutable reference to the entity's components.
Definition sparse_set.h:143
static Container::SparseSet< T > & GetPool(EntityManager *manager)
Get the component pool for a specific component type.
Definition component_manager.h:44
static void Reserve(std::size_t size)
Reserves storage space for predicted number of component types.
Definition component_manager.h:79
static void DeleteEntity(Entity e)
Removes an entity from all registered component pools.
Definition component_manager.h:91
static std::uint32_t & GetVersion()
Returns a per-type version reference for tracking changes.
Definition component_manager.h:66
Manages entity lifecycle, including creation, destruction, and version tracking.
Definition entity_manager.h:21
void Attach(Entity e, const T &component)
Attachs a component to an entity.
Definition registry.h:121
bool Has(Entity e)
Checks if a given component type exists on an entity.
Definition registry.h:167
Registry()
Constructs a new Registry Instance.
Definition registry.h:29
T & Get(Entity e)
Retrieves a component reference attached to an entity.
Definition registry.h:138
void Reserve(std::size_t size)
Reserve a predicted amount of components.
Definition registry.h:82
void Detach(Entity e)
Detaches a component from an entity.
Definition registry.h:151
bool IsEntityAlive(Entity id) const
Checks whether the given entity is still alive.
Definition registry.h:64
void DestroyEntity(Entity id)
Destroys an Entity and Removes its components.
Definition registry.h:47
Container::SparseSet< T > & GetPool()
Retrieves the pool for a given component type.
Definition registry.h:108
FECS::View< C... > View()
Creates a view for the specified component types.
Definition registry.h:180
Entity CreateEntity()
Creates a new Entity.
Definition registry.h:37
EntityManager & GetEntityManager()
Get the local entity manager.
Definition registry.h:73
Container::SparseSet< T > & RegisterComponent()
Registers a new Component Type and returns its Pool.
Definition registry.h:94
A view for iterating over entities that have all specified component types.
Definition view_manager.h:29
Manages component pools and provides utility functions for component lifecycle operations.
Defines the EntityManager, which handles creation and destruction of entities.
Defines the SparseSet data structure for fast component storage and lookup.
std::uint32_t Entity
Type alias for entity IDs (32-bit unsigned integer)
Definition types.h:28
Defines the FECS::View class for iterating over entities that have specific components.