Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ComponentManager Class Reference

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...
 

Detailed Description

Class for component manager.

Member Function Documentation

void ComponentManager::addComponent ( std::shared_ptr< Component component)

Adds a component.

Parameters
[in]componentThe component

References Entity::components.

Referenced by generated::getComponentManagerModule(), and Engine::setup().

void ComponentManager::addComponent ( std::shared_ptr< Graphics::Camera component)

Adds a camera.

Parameters
[in]componentThe component

References Entity::components.

void ComponentManager::addComponents ( std::vector< std::shared_ptr< Component >>  components)

Adds components.

Parameters
[in]componentsThe components

References Entity::components.

Referenced by generated::getComponentManagerModule().

void ComponentManager::addComponents ( std::list< std::shared_ptr< Component >>  components)

Adds components.

Parameters
[in]componentsThe components

References Entity::components.

unsigned int ComponentManager::count ( ) const
noexcept

Gets the number of components.

Returns
# 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.

Parameters
[in]deltaThe delta

References Entity::components.

void ComponentManager::removeComponent ( std::shared_ptr< Component component)

Removes a component.

Parameters
[in]componentThe component

References Entity::components.

Referenced by generated::getComponentManagerModule(), and removeComponents().

void ComponentManager::removeComponents ( std::vector< std::shared_ptr< Component >>  components)

Removes components.

Parameters
[in]componentsThe components

References Entity::components, and removeComponent().

Referenced by generated::getComponentManagerModule().


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