Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::component::HasComponents< Entity, ComponentType > Class Template Reference

Util class to add components handling to an entity. More...

#include <OxygenEngine/scene/component/component.h>

Collaboration diagram for oe::component::HasComponents< Entity, ComponentType >:
[legend]

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
 

Detailed Description

template<typename Entity, typename ComponentType>
class oe::component::HasComponents< Entity, ComponentType >

Util class to add components handling to an entity.


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