Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ComponentPool< T > Class Template Reference

#include <ECS_Register.h>

+ Inheritance diagram for ComponentPool< T >:
+ Collaboration diagram for ComponentPool< T >:

Public Member Functions

 ComponentPool ()
 
void RemoveComponent (EntityID entity) override
 
template<typename... Args>
void AddComponent (EntityID entity, Args &&... args)
 
TGetComponent (EntityID entity)
 
bool HasComponent (EntityID entity) const
 
- Public Member Functions inherited from IComponentPool
virtual ~IComponentPool ()=default
 

Public Attributes

std::vector< Tm_data
 
std::unordered_map< EntityID, size_tm_entityToIndex
 
std::vector< EntityIDm_indexToEntity
 

Detailed Description

template<typename T>
class ComponentPool< T >
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 19 of file ECS_Register.h.

Constructor & Destructor Documentation

◆ ComponentPool()

template<typename T >
ComponentPool< T >::ComponentPool ( )
inline

Definition at line 29 of file ECS_Register.h.

Member Function Documentation

◆ AddComponent()

template<typename T >
template<typename... Args>
void ComponentPool< T >::AddComponent ( EntityID  entity,
Args &&...  args 
)
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 67 of file ECS_Register.h.

References GetComponentTypeID_Static(), ComponentPool< T >::m_data, ComponentPool< T >::m_entityToIndex, and ComponentPool< T >::m_indexToEntity.

Referenced by World::AddComponent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetComponent()

template<typename T >
T & ComponentPool< T >::GetComponent ( EntityID  entity)
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 79 of file ECS_Register.h.

References ComponentPool< T >::m_data, and ComponentPool< T >::m_entityToIndex.

Referenced by World::GetComponent().

+ Here is the caller graph for this function:

◆ HasComponent()

template<typename T >
bool ComponentPool< T >::HasComponent ( EntityID  entity) const
inline
Examples
/home/runner/work/Olympe-Engine/Olympe-Engine/Source/World.h.

Definition at line 88 of file ECS_Register.h.

References ComponentPool< T >::m_entityToIndex.

Referenced by World::HasComponent().

+ Here is the caller graph for this function:

◆ RemoveComponent()

template<typename T >
void ComponentPool< T >::RemoveComponent ( EntityID  entity)
inlineoverridevirtual

Implements IComponentPool.

Definition at line 37 of file ECS_Register.h.

References GetComponentTypeID_Static(), ComponentPool< T >::m_data, ComponentPool< T >::m_entityToIndex, and ComponentPool< T >::m_indexToEntity.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_data

template<typename T >
std::vector<T> ComponentPool< T >::m_data

◆ m_entityToIndex

template<typename T >
std::unordered_map<EntityID, size_t> ComponentPool< T >::m_entityToIndex

◆ m_indexToEntity

template<typename T >
std::vector<EntityID> ComponentPool< T >::m_indexToEntity

The documentation for this class was generated from the following file: