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

Class for entity in the engine. More...

#include <entity.h>

Inheritance diagram for Entity:

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< TransformgetTransform () 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
 

Detailed Description

Class for entity in the engine.

Constructor & Destructor Documentation

Entity::Entity ( )

Entity constructor.

Member Function Documentation

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

Adds a component.

Parameters
[in]componentThe component

References components.

Referenced by generated::getEntityModule().

std::list< std::shared_ptr< Component > > & Entity::getComponents ( )
noexcept

Gets the components.

Returns
The components.

References components.

Referenced by generated::getEntityModule().

std::shared_ptr< Transform > Entity::getTransform ( ) const
noexcept

Gets the transform.

Returns
The transform.

Referenced by generated::getEntityModule().

bool Entity::isActive ( ) const
noexcept

Determines if active.

Returns
True if active, False otherwise.

Referenced by generated::getEntityModule().

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

Removes a component.

Parameters
[in]componentThe component

References components.

Referenced by generated::getEntityModule().

void Entity::setActive ( const bool  active)
noexcept

Sets entity active or inactive.

Parameters
[in]activeTrue if active

Referenced by generated::getEntityModule().

Member Data Documentation


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