Oxygen Engine
Modern C++ 3D Engine using OpenGL
|
Util class to add components handling to an entity. More...
#include <OxygenEngine/scene/component/component.h>
Public Member Functions | |
HasComponents (Entity &entity) | |
ComponentList< Entity, ComponentType > & | getComponents () noexcept |
Get components bound to the entity. | |
const ComponentList< Entity, ComponentType > & | getComponents () const noexcept |
Get components bound to the entity. | |
template<typename T = ComponentType, typename ... Args> | |
std::shared_ptr< T > | addComponent (Args &&... args) |
Add a new a component. | |
template<typename T = ComponentType, typename ... Args> | |
std::shared_ptr< T > | addNamedComponent (const std::string &name, Args &&... args) |
Add a new a component. | |
void | removeComponent (const std::string &name) |
Remove a component. | |
template<typename T > | |
const T * | getComponentByType () const noexcept |
Fetch a component by its type. | |
template<typename T > | |
T * | getComponentByType () noexcept |
Fetch a component by its type. | |
template<typename T = ComponentType> | |
T * | getComponentByName (const std::string &name) noexcept |
Fetch a component when you know its name. | |
template<typename T = ComponentType> | |
const T * | getComponentByName (const std::string &name) const noexcept |
Fetch a component when you know its name. | |
Protected Attributes | |
ComponentList< Entity, ComponentType > | _components |
Util class to add components handling to an entity.