Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::ArchetypeGraph Class Reference

Public Member Functions

void add_edge_right (Entity entity, ArchetypeId archetypeId, ArchetypeIdHash hash)
 Creates an "add" edge in the graph leading to the target archetype.
 
void add_edge_left (Entity entity, ArchetypeId archetypeId, ArchetypeIdHash hash)
 Creates a "del" edge in the graph leading to the target archetype.
 
void del_edge_right (Entity entity)
 Deletes the "add" edge formed by the entity entity.
 
void del_edge_left (Entity entity)
 Deletes the "del" edge formed by the entity entity.
 
GAIA_NODISCARD ArchetypeGraphEdge find_edge_right (Entity entity) const
 Checks if an archetype graph "add" edge with entity entity exists.
 
GAIA_NODISCARD ArchetypeGraphEdge find_edge_left (Entity entity) const
 Checks if an archetype graph "del" edge with entity entity exists.
 
GAIA_NODISCARD auto & right_edges ()
 
GAIA_NODISCARD const auto & right_edges () const
 
GAIA_NODISCARD auto & left_edges ()
 
GAIA_NODISCARD const auto & left_edges () const
 
void diag (const World &world) const
 

Member Function Documentation

◆ add_edge_left()

void gaia::ecs::ArchetypeGraph::add_edge_left ( Entity  entity,
ArchetypeId  archetypeId,
ArchetypeIdHash  hash 
)
inline

Creates a "del" edge in the graph leading to the target archetype.

Parameters
entityEdge entity.
archetypeIdTarget archetype.
hashArchetype hash.

◆ add_edge_right()

void gaia::ecs::ArchetypeGraph::add_edge_right ( Entity  entity,
ArchetypeId  archetypeId,
ArchetypeIdHash  hash 
)
inline

Creates an "add" edge in the graph leading to the target archetype.

Parameters
entityEdge entity.
archetypeIdTarget archetype.
hashArchetype hash.

◆ del_edge_left()

void gaia::ecs::ArchetypeGraph::del_edge_left ( Entity  entity)
inline

Deletes the "del" edge formed by the entity entity.

Parameters
entityEdge entity.

◆ del_edge_right()

void gaia::ecs::ArchetypeGraph::del_edge_right ( Entity  entity)
inline

Deletes the "add" edge formed by the entity entity.

Parameters
entityEdge entity.

◆ find_edge_left()

GAIA_NODISCARD ArchetypeGraphEdge gaia::ecs::ArchetypeGraph::find_edge_left ( Entity  entity) const
inline

Checks if an archetype graph "del" edge with entity entity exists.

Parameters
entityEdge entity.
Returns
Archetype id of the target archetype if the edge is found. ArchetypeGraphEdgeBad otherwise.

◆ find_edge_right()

GAIA_NODISCARD ArchetypeGraphEdge gaia::ecs::ArchetypeGraph::find_edge_right ( Entity  entity) const
inline

Checks if an archetype graph "add" edge with entity entity exists.

Parameters
entityEdge entity.
Returns
Archetype id of the target archetype if the edge is found. ArchetypeGraphEdgeBad otherwise.

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