class

Entity

Lightweight entity handle.

Module
ECS
Header
#include "ECS/Entity.h"
Namespace
Mowo

Properties

TypeNameDescription
bool operator<(const Entity& other)const

Constructors

SignatureNameDescription
Entity() : m_id(INVALID_ENTITY), m_world(nullptr)Entity
Entity(EntityID id, World* world) : m_id(id), m_world(world)Entity
Entity(EntityID id, World* world, uint32_t slotHint) : m_id(id), m_world(world),…EntityForEach passes the row's World slot along, so a GetComponent on the entity it hands out skips the id → slot hash.

Public functions

ReturnsNameDescription
boolIsValid
operatorbool
EntityIDGetID
booloperator==
booloperator!=
T&AddComponentDefined in World.h — Entity must not depend on World here.
voidRemoveComponent
T*GetComponent
const T*GetComponent
boolHasComponent
voidDestroy
World*GetWorld

Function details

Entity

C++
Entity() : m_id(INVALID_ENTITY), m_world(nullptr)

Entity

C++
Entity(EntityID id, World* world) : m_id(id), m_world(world)

Entity

C++
Entity(EntityID id, World* world, uint32_t slotHint) : m_id(id), m_world(world), m_slotHint(slotHint)

ForEach passes the row's World slot along, so a GetComponent on the entity it hands out skips the id → slot hash. The hint is checked against the id on every use and falls back to the hash when stale.

IsValid

C++
bool IsValid() const

operatorbool

C++
explicit operator bool() const

GetID

C++
EntityID GetID() const

operator==

C++
bool operator==(const Entity& other) const

operator!=

C++
bool operator!=(const Entity& other) const

AddComponent

C++
template<typename T, typename... Args> T& AddComponent(Args&&... args)

Defined in World.h — Entity must not depend on World here.

RemoveComponent

C++
template<typename T> void RemoveComponent()

GetComponent

C++
template<typename T> T* GetComponent()

GetComponent

C++
template<typename T> const T* GetComponent() const

HasComponent

C++
template<typename T> bool HasComponent() const

Destroy

C++
void Destroy()

GetWorld

C++
World* GetWorld() const
Generated from ECS/Entity.h via ecs.json · Nov 4, 2026Version 1.0.0