Finality Engine
Loading...
Searching...
No Matches
FINALITY::Entity Class Reference

Provides a scene-bound handle for component and hierarchy operations. More...

#include <Entity.h>

Public Member Functions

 Entity ()
 Entity (const Entity &)
 Entity (Entity &&) noexcept
Entity & operator= (const Entity &)
Entity & operator= (Entity &&) noexcept
 ~Entity ()
template<typename T, typename... Args>
T & AddScript (Args &&... args)
template<typename T, typename... Args>
T & AddComponent (Args &&... args)
template<typename T>
T & GetComponent ()
template<typename T>
bool HasComponent () const
template<typename T>
void RemoveComponent ()
entt::entity GetHandle () const
bool IsValid () const
 Checks that the scene still exists and the entity handle is valid.
void SetParent (Entity parent)

Friends

class Scene
class SceneSerializer
class ScriptableComponent

Detailed Description

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.

Constructor & Destructor Documentation

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

Member Function Documentation

◆ 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

Definition at line 61 of file Entity.h.

◆ 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

friend class Scene
friend

Definition at line 76 of file Entity.h.

◆ SceneSerializer

friend class SceneSerializer
friend

Definition at line 77 of file Entity.h.

◆ ScriptableComponent

friend class ScriptableComponent
friend

Definition at line 78 of file Entity.h.


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