class
Entity
Lightweight entity handle.
- Module
- ECS
- Header
#include "ECS/Entity.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
bool operator<(const Entity& other) | const |
Constructors
| Signature | Name | Description |
|---|---|---|
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),… | Entity | ForEach passes the row's World slot along, so a GetComponent on the entity it hands out skips the id → slot hash. |
Public functions
| Returns | Name | Description |
|---|---|---|
bool | IsValid | |
operatorbool | ||
EntityID | GetID | |
bool | operator== | |
bool | operator!= | |
T& | AddComponent | Defined in World.h — Entity must not depend on World here. |
void | RemoveComponent | |
T* | GetComponent | |
const T* | GetComponent | |
bool | HasComponent | |
void | Destroy | |
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() constoperatorbool
C++
explicit operator bool() constGetID
C++
EntityID GetID() constoperator==
C++
bool operator==(const Entity& other) constoperator!=
C++
bool operator!=(const Entity& other) constAddComponent
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() constHasComponent
C++
template<typename T> bool HasComponent() constDestroy
C++
void Destroy()GetWorld
C++
World* GetWorld() constGenerated from ECS/Entity.h via ecs.json · Nov 4, 2026Version 1.0.0