Nymph Game Engine
Chaiscript based Game Engine
|
Class for entity in the engine. More...
#include <entity.h>
Public Member Functions | |
Entity () | |
Entity constructor. More... | |
void | addComponent (std::shared_ptr< Component > component) |
Adds a component. More... | |
void | removeComponent (std::shared_ptr< Component > component) |
Removes a component. More... | |
std::list< std::shared_ptr < Component > > & | getComponents () noexcept |
Gets the components. More... | |
std::shared_ptr< Transform > | getTransform () const noexcept |
Gets the transform. More... | |
void | setActive (const bool active) noexcept |
Sets entity active or inactive. More... | |
bool | isActive () const noexcept |
Determines if active. More... | |
Protected Attributes | |
std::list< std::shared_ptr < Component > > | components |
Class for entity in the engine.
Entity::Entity | ( | ) |
Entity constructor.
void Entity::addComponent | ( | std::shared_ptr< Component > | component | ) |
Adds a component.
[in] | component | The component |
References components.
Referenced by generated::getEntityModule().
|
noexcept |
Gets the components.
References components.
Referenced by generated::getEntityModule().
|
noexcept |
|
noexcept |
Determines if active.
Referenced by generated::getEntityModule().
void Entity::removeComponent | ( | std::shared_ptr< Component > | component | ) |
Removes a component.
[in] | component | The component |
References components.
Referenced by generated::getEntityModule().
|
noexcept |
Sets entity active or inactive.
[in] | active | True if active |
Referenced by generated::getEntityModule().
|
protected |
Referenced by ComponentManager::addComponent(), addComponent(), ComponentManager::addComponents(), ComponentManager::count(), ComponentManager::destroy(), getComponents(), ComponentManager::onStart(), ComponentManager::onUpdate(), removeComponent(), ComponentManager::removeComponent(), and ComponentManager::removeComponents().