Nazara Engine
0.4
A fast, complete, cross-platform API designed for game development
|
NDK class that represents an entity in a world. More...
Inherits Nz::HandledObject< T >.
Public Member Functions | |
Entity (const Entity &)=delete | |
Entity (Entity &&entity) | |
Constructs a Entity object by move semantic. More... | |
~Entity () | |
Destructs the object and calls Destroy. More... | |
BaseComponent & | AddComponent (std::unique_ptr< BaseComponent > &&component) |
Adds a component to the entity. More... | |
template<typename ComponentType , typename... Args> | |
ComponentType & | AddComponent (Args &&... args) |
Adds a component to the entity. More... | |
const EntityHandle & | Clone () const |
Clones the entity. More... | |
void | Enable (bool enable=true) |
Enables the entity. More... | |
BaseComponent & | GetComponent (ComponentIndex index) |
Gets a component in the entity by index. More... | |
template<typename ComponentType > | |
ComponentType & | GetComponent () |
Gets a component in the entity by type. More... | |
const BaseComponent & | GetComponent (ComponentIndex index) const |
Gets a component in the entity by index. More... | |
template<typename ComponentType > | |
const ComponentType & | GetComponent () const |
Gets a component in the entity by type. More... | |
const Nz::Bitset & | GetComponentBits () const |
Gets the bits representing the components in the entiy. More... | |
EntityId | GetId () const |
Gets the identifier of the entity. More... | |
const Nz::Bitset & | GetSystemBits () const |
Gets the bits representing the systems in the entiy. More... | |
World * | GetWorld () const |
Gets the world in which the entity is. More... | |
bool | HasComponent (ComponentIndex index) const |
Checks whether or not a component is present in the entity by index. More... | |
template<typename ComponentType > | |
bool | HasComponent () const |
Checks whether or not a component is present in the entity by type. More... | |
void | Kill () |
Kills the entity. | |
void | Invalidate () |
Invalidates the entity. | |
bool | IsEnabled () const |
Checks whether or not the entity is enabled. More... | |
bool | IsValid () const |
Checks whether or not the entity is valid. More... | |
void | RemoveAllComponents () |
Removes every components. | |
void | RemoveComponent (ComponentIndex index) |
Removes a component in the entity by index. More... | |
template<typename ComponentType > | |
void | RemoveComponent () |
Removes a component in the entity by type. | |
Nz::String | ToString () const |
Gives a string representation. More... | |
Entity & | operator= (const Entity &)=delete |
Entity & | operator= (Entity &&)=delete |
NazaraSignal (OnEntityDestruction, Entity *) | |
NDK class that represents an entity in a world.
Ndk::Entity::Entity | ( | Entity && | entity | ) |
Ndk::Entity::~Entity | ( | ) |
Destructs the object and calls Destroy.
BaseComponent & Ndk::Entity::AddComponent | ( | std::unique_ptr< BaseComponent > && | componentPtr | ) |
Adds a component to the entity.
componentPtr | Component to add to the entity |
ComponentType & Ndk::Entity::AddComponent | ( | Args &&... | args | ) |
Adds a component to the entity.
args | Arguments to create in place the component to add to the entity |
const EntityHandle & Ndk::Entity::Clone | ( | ) | const |
Clones the entity.
|
inline |
Enables the entity.
enable | Should the entity be enabled |
|
inline |
Gets a component in the entity by index.
index | Index of the component |
ComponentType & Ndk::Entity::GetComponent | ( | ) |
Gets a component in the entity by type.
|
inline |
Gets a component in the entity by index.
index | Index of the component |
const ComponentType & Ndk::Entity::GetComponent | ( | ) | const |
Gets a component in the entity by type.
|
inline |
Gets the bits representing the components in the entiy.
|
inline |
Gets the identifier of the entity.
|
inline |
Gets the bits representing the systems in the entiy.
|
inline |
Gets the world in which the entity is.
|
inline |
Checks whether or not a component is present in the entity by index.
index | Index of the component |
bool Ndk::Entity::HasComponent | ( | ) | const |
Checks whether or not a component is present in the entity by type.
|
inline |
Checks whether or not the entity is enabled.
|
inline |
Checks whether or not the entity is valid.
|
inline |
Removes a component in the entity by index.
index | Index of the component |
|
inline |
Gives a string representation.