Provides a scene-bound handle for component and hierarchy operations.
More...
#include <Entity.h>
Provides a scene-bound handle for component and hierarchy operations.
Entity wraps an EnTT handle and a non-owning Scene pointer. A weak lifetime token prevents IsValid from accepting handles whose scene has expired. Copying the wrapper does not clone the underlying entity.
- Usage
- Check IsValid before using a stored handle. Use Scene::DuplicateEntity to copy an entity hierarchy; use SetParent to change hierarchy relationships.
Definition at line 33 of file Entity.h.
◆ Entity() [1/3]
| FINALITY::Entity::Entity |
( |
| ) |
|
◆ Entity() [2/3]
| FINALITY::Entity::Entity |
( |
const Entity & | | ) |
|
◆ Entity() [3/3]
| FINALITY::Entity::Entity |
( |
Entity && | | ) |
|
|
noexcept |
◆ ~Entity()
| FINALITY::Entity::~Entity |
( |
| ) |
|
◆ operator=() [1/2]
| Entity & FINALITY::Entity::operator= |
( |
const Entity & | | ) |
|
◆ operator=() [2/2]
| Entity & FINALITY::Entity::operator= |
( |
Entity && | | ) |
|
|
noexcept |
◆ AddScript()
template<typename T, typename... Args>
| T & FINALITY::Entity::AddScript |
( |
Args &&... | args | ) |
|
◆ AddComponent()
template<typename T, typename... Args>
| T & FINALITY::Entity::AddComponent |
( |
Args &&... | args | ) |
|
◆ GetComponent()
template<typename T>
| T & FINALITY::Entity::GetComponent |
( |
| ) |
|
◆ HasComponent()
template<typename T>
| bool FINALITY::Entity::HasComponent |
( |
| ) |
const |
◆ RemoveComponent()
template<typename T>
| void FINALITY::Entity::RemoveComponent |
( |
| ) |
|
◆ GetHandle()
| entt::entity FINALITY::Entity::GetHandle |
( |
| ) |
const |
|
inline |
◆ IsValid()
| bool FINALITY::Entity::IsValid |
( |
| ) |
const |
|
inline |
Checks that the scene still exists and the entity handle is valid.
- Returns
- True when the lifetime token, scene pointer and registry handle are valid. This is a current-state check; it does not transfer ownership of the scene.
Definition at line 67 of file Entity.h.
◆ SetParent()
| void FINALITY::Entity::SetParent |
( |
Entity | parent | ) |
|
◆ Scene
◆ SceneSerializer
| friend class SceneSerializer |
|
friend |
◆ ScriptableComponent
| friend class ScriptableComponent |
|
friend |
The documentation for this class was generated from the following file: