This object is able a holder object for components. NOTE: only the EntitySystem is allowed to create this object.
More...
#include <Entity.hpp>
|
| virtual | ~Entity ()=default |
| |
| template<typename ComponentType > |
| eastl::weak_ptr< ComponentType > | GetComponent () |
| | This method allows you to get the first component of the given type. More...
|
| |
| template<typename ComponentType > |
| eastl::vector< eastl::weak_ptr< ComponentType > > | GetComponents () |
| | This method allows you to get all of the components of the given type. More...
|
| |
| eastl::vector< eastl::shared_ptr< Component > > | GetAllComponents () const |
| | Returns all the components of this entity. More...
|
| |
| template<class ComponentType , class... Args> |
| eastl::weak_ptr< ComponentType > | AddComponent (Args &&...args) |
| | Allows you to create a component of the given type. More...
|
| |
| template<class ComponentType , class... Args> |
| eastl::vector< eastl::weak_ptr< ComponentType > > | AddComponents (size_t count, Args &&...args) |
| | Allows you to create X amount of components of the given type. More...
|
| |
| template<typename ComponentType > |
| void | RemoveComponent (size_t amountToRemove=1) |
| | Allows X amount of components of the given type. More...
|
| |
| template<typename ComponentType > |
| void | RemoveAllComponents () |
| | Deletes all the components of the given type. More...
|
| |
| eastl::shared_ptr< Entity > | GetPointer () const |
| | Allows you to retrieve current shared pointer from the entity system. More...
|
| |
| virtual void | Update () |
| | The general update method of the Entity class. More...
|
| |
| size_t | ComponentCount () const |
| | Returns the amount of components on this entity. More...
|
| |
| uint64_t | GetID () const |
| | Returns the currently assigned ID of this entity. More...
|
| |
| bool | GetIsActive () const |
| | This method will return the active state of this entity. More...
|
| |
| void | SetIsActive (bool isActive) |
| | This method will allow you to change the active state of this entity. More...
|
| |
This object is able a holder object for components. NOTE: only the EntitySystem is allowed to create this object.
Definition at line 13 of file Entity.hpp.
| virtual Engine::Entity::~Entity |
( |
| ) |
|
|
virtualdefault |
| Engine::Entity::Entity |
( |
eastl::string |
name = "" | ) |
|
|
explicitprotected |
template<class ComponentType , class... Args>
| eastl::weak_ptr< ComponentType > Engine::Entity::AddComponent |
( |
Args &&... |
args | ) |
|
Allows you to create a component of the given type.
- Parameters
-
| ...args | The arguments required to initialize the component. |
- Returns
- Returns the just created component of the given type as a weak pointer.
Definition at line 161 of file Entity.hpp.
template<class ComponentType , class... Args>
| eastl::vector< eastl::weak_ptr< ComponentType > > Engine::Entity::AddComponents |
( |
size_t |
count, |
|
|
Args &&... |
args |
|
) |
| |
Allows you to create X amount of components of the given type.
- Parameters
-
| count | The amount of components you want to add of this given type. |
| ...args | The arguments required to initialize the components. |
- Returns
- Returns a vector of the just created components of the given type as a vector of weak pointers.
Definition at line 180 of file Entity.hpp.
| size_t Engine::Entity::ComponentCount |
( |
| ) |
const |
Returns the amount of components on this entity.
- Returns
Definition at line 39 of file Entity.cpp.
| eastl::vector< eastl::shared_ptr< Component > > Engine::Entity::GetAllComponents |
( |
| ) |
const |
Returns all the components of this entity.
- Returns
- Returns a vector of all the components of this entity.
Definition at line 15 of file Entity.cpp.
template<typename ComponentType >
| eastl::weak_ptr< ComponentType > Engine::Entity::GetComponent |
( |
| ) |
|
This method allows you to get the first component of the given type.
- Returns
- Returns the first component of the given type as a weak pointer.
Definition at line 134 of file Entity.hpp.
template<typename ComponentType >
| eastl::vector< eastl::weak_ptr< ComponentType > > Engine::Entity::GetComponents |
( |
| ) |
|
This method allows you to get all of the components of the given type.
- Returns
- Returns the all of the components of the given type as a weak pointer.
Definition at line 147 of file Entity.hpp.
| uint64_t Engine::Entity::GetID |
( |
| ) |
const |
Returns the currently assigned ID of this entity.
- Returns
Definition at line 44 of file Entity.cpp.
| bool Engine::Entity::GetIsActive |
( |
| ) |
const |
This method will return the active state of this entity.
- Returns
- Returns true if this entity is active.
Definition at line 49 of file Entity.cpp.
| eastl::shared_ptr< Entity > Engine::Entity::GetPointer |
( |
| ) |
const |
Allows you to retrieve current shared pointer from the entity system.
- Returns
Definition at line 20 of file Entity.cpp.
| void Engine::Entity::InitializeEntity |
( |
| ) |
|
|
protectedvirtual |
template<typename ComponentType >
| void Engine::Entity::RemoveAllComponents |
( |
| ) |
|
Deletes all the components of the given type.
Definition at line 225 of file Entity.hpp.
template<typename ComponentType >
| void Engine::Entity::RemoveComponent |
( |
size_t |
amountToRemove = 1 | ) |
|
Allows X amount of components of the given type.
- Parameters
-
| amountToRemove | Will remove 1 component by default, can be change optionally. |
Definition at line 205 of file Entity.hpp.
| void Engine::Entity::SetIsActive |
( |
bool |
isActive | ) |
|
This method will allow you to change the active state of this entity.
- Parameters
-
| isActive | This value will define if this entity will be active or not. |
Definition at line 54 of file Entity.cpp.
| void Engine::Entity::Update |
( |
| ) |
|
|
virtual |
| eastl::vector<eastl::shared_ptr<Component> > Engine::Entity::components |
|
protected |
| uint64_t Engine::Entity::Id |
|
protected |
| eastl::string Engine::Entity::name |
The name of this entity.
Definition at line 98 of file Entity.hpp.
The documentation for this class was generated from the following files: