Nymph Game Engine
Chaiscript based Game Engine
|
Class for component manager. More...
#include <component_manager.h>
Public Member Functions | |
void | addComponent (std::shared_ptr< Component > component) |
Adds a component. More... | |
void | addComponents (std::vector< std::shared_ptr< Component >> components) |
Adds components. More... | |
void | addComponents (std::list< std::shared_ptr< Component >> components) |
Adds components. More... | |
void | removeComponent (std::shared_ptr< Component > component) |
Removes a component. More... | |
void | removeComponents (std::vector< std::shared_ptr< Component >> components) |
Removes components. More... | |
unsigned int | count () const noexcept |
Gets the number of components. More... | |
void | addComponent (std::shared_ptr< Graphics::Camera > component) |
Adds a camera. More... | |
void | onStart () |
Calls onStart on each component. More... | |
void | onUpdate (const float delta) |
Calls onUpdate on each component, once per frame. More... | |
void | destroy () |
Calls onDestroy on each component. More... | |
Class for component manager.
void ComponentManager::addComponent | ( | std::shared_ptr< Component > | component | ) |
Adds a component.
[in] | component | The component |
References Entity::components.
Referenced by generated::getComponentManagerModule(), and Engine::setup().
void ComponentManager::addComponent | ( | std::shared_ptr< Graphics::Camera > | component | ) |
void ComponentManager::addComponents | ( | std::vector< std::shared_ptr< Component >> | components | ) |
Adds components.
[in] | components | The components |
References Entity::components.
Referenced by generated::getComponentManagerModule().
void ComponentManager::addComponents | ( | std::list< std::shared_ptr< Component >> | components | ) |
|
noexcept |
Gets the number of components.
References Entity::components.
Referenced by generated::getComponentManagerModule().
void ComponentManager::destroy | ( | ) |
Calls onDestroy on each component.
References Entity::components.
void ComponentManager::onStart | ( | ) |
Calls onStart on each component.
References Entity::components.
void ComponentManager::onUpdate | ( | const float | delta | ) |
Calls onUpdate on each component, once per frame.
[in] | delta | The delta |
References Entity::components.
void ComponentManager::removeComponent | ( | std::shared_ptr< Component > | component | ) |
Removes a component.
[in] | component | The component |
References Entity::components.
Referenced by generated::getComponentManagerModule(), and removeComponents().
void ComponentManager::removeComponents | ( | std::vector< std::shared_ptr< Component >> | components | ) |
Removes components.
[in] | components | The components |
References Entity::components, and removeComponent().
Referenced by generated::getComponentManagerModule().