Component holder that can be bound to an entity.
More...
#include <OxygenEngine/scene/component/component.h>
|
| ComponentList (Entity &entity) |
|
template<typename T = ComponentType, typename ... Args> |
std::shared_ptr< T > | addNamed (const std::string &name, Args &&...args) |
| Add a new a component.
|
|
template<typename T = ComponentType, typename ... Args> |
std::shared_ptr< T > | add (Args &&...args) |
| Add a new a component.
|
|
template<typename T = ComponentType> |
const T * | getComponentByName (const std::string &name) const noexcept |
| Fetch a component when you know its name (const version)
|
|
template<typename T = ComponentType> |
T * | getComponentByName (const std::string &name) noexcept |
| Fetch a component when you know its name.
|
|
template<typename T > |
const T * | getComponentByType () const noexcept |
| Fetch a component by its type (const version)
|
|
template<typename T > |
T * | getComponentByType () noexcept |
| Fetch a component by its type.
|
|
void | remove (const std::string &name) |
| Remove a component.
|
|
void | update (const double delta, const int8_t flags=0) const |
| Update all components.
|
|
ComponentContainer::iterator | begin () noexcept |
|
ComponentContainer::iterator | end () noexcept |
|
const ComponentContainer::const_iterator | begin () const noexcept |
|
const ComponentContainer::const_iterator | end () const noexcept |
|
const ComponentContainer::const_iterator | cbegin () const noexcept |
|
const ComponentContainer::const_iterator | cend () const noexcept |
|
template<typename Entity, typename ComponentType = EntityComponent<Entity>>
class oe::component::ComponentList< Entity, ComponentType >
Component holder that can be bound to an entity.
◆ begin() [1/2]
template<typename Entity , typename ComponentType = EntityComponent<Entity>>
- Returns
- constant iterator at begining of components list
◆ begin() [2/2]
template<typename Entity , typename ComponentType = EntityComponent<Entity>>
- Returns
- iterator at begining of components list
◆ cbegin()
template<typename Entity , typename ComponentType = EntityComponent<Entity>>
- Returns
- constant iterator at begining of components list
◆ cend()
template<typename Entity , typename ComponentType = EntityComponent<Entity>>
- Returns
- constant iterator at end of components list
◆ end() [1/2]
template<typename Entity , typename ComponentType = EntityComponent<Entity>>
- Returns
- constant iterator at end of components list
◆ end() [2/2]
template<typename Entity , typename ComponentType = EntityComponent<Entity>>
- Returns
- iterator at end of components list
◆ update()
template<typename Entity , typename ComponentType = EntityComponent<Entity>>
Update all components.
The flags
value is not used by OxygenEngine, but you can use it to implement differents levels of update For example, other engines uses functions such as BeforeUpdate, PreUpdate, PostUpdate, LateUpdate, etc Here, it would translates to using custom flags values
- Parameters
-
delta | seconds since last call of this function |
flags | custom flags |
The documentation for this class was generated from the following file:
- OxygenEngine/scene/component/component.h