Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::detail::NonFragmentingRelationStore Struct Reference

Storage for exclusive relation pairs that do not fragment archetypes. More...

#include <nonfragmenting_relation_store.h>

Public Member Functions

void ensure_source_capacity (Entity source)
 Ensures source-indexed storage can hold source.
 
void ensure_target_capacity (Entity target)
 Ensures target-indexed storage can hold target.
 
GAIA_NODISCARD Entity target (Entity source) const
 Returns the target currently bound to source.
 
GAIA_NODISCARD const cnt::darray< Entity > * sources (Entity target) const
 Returns sources currently bound to target.
 
GAIA_NODISCARD uint32_t source_count () const
 Returns the number of active source bindings.
 
void collect_source_ids (cnt::darray< EntityId > &out) const
 Appends ids of all bound source entities.
 
void remove_target_source (Entity target, Entity source)
 Removes source from the source bucket for target.
 
GAIA_NODISCARD bool set (Entity source, Entity target)
 Binds source to target.
 
GAIA_NODISCARD bool remove (Entity source, Entity target)
 Removes source from the store.
 
GAIA_NODISCARD bool empty () const
 Checks whether the store has no source bindings.
 

Detailed Description

Storage for exclusive relation pairs that do not fragment archetypes.

Member Function Documentation

◆ collect_source_ids()

void gaia::ecs::detail::NonFragmentingRelationStore::collect_source_ids ( cnt::darray< EntityId > &  out) const
inline

Appends ids of all bound source entities.

Parameters
outOutput array receiving source entity ids.

◆ empty()

GAIA_NODISCARD bool gaia::ecs::detail::NonFragmentingRelationStore::empty ( ) const
inline

Checks whether the store has no source bindings.

Returns
True when no source is bound.

◆ ensure_source_capacity()

void gaia::ecs::detail::NonFragmentingRelationStore::ensure_source_capacity ( Entity  source)
inline

Ensures source-indexed storage can hold source.

Parameters
sourceSource entity.

◆ ensure_target_capacity()

void gaia::ecs::detail::NonFragmentingRelationStore::ensure_target_capacity ( Entity  target)
inline

Ensures target-indexed storage can hold target.

Parameters
targetTarget entity.

◆ remove()

GAIA_NODISCARD bool gaia::ecs::detail::NonFragmentingRelationStore::remove ( Entity  source,
Entity  target 
)
inline

Removes source from the store.

Parameters
sourceSource entity.
targetRequired target, or EntityBad to remove any target.
Returns
True when a binding was removed.

◆ remove_target_source()

void gaia::ecs::detail::NonFragmentingRelationStore::remove_target_source ( Entity  target,
Entity  source 
)
inline

Removes source from the source bucket for target.

Parameters
targetTarget entity.
sourceSource entity.

◆ set()

GAIA_NODISCARD bool gaia::ecs::detail::NonFragmentingRelationStore::set ( Entity  source,
Entity  target 
)
inline

Binds source to target.

Parameters
sourceSource entity.
targetTarget entity.
Returns
True when the stored binding changed.

◆ source_count()

GAIA_NODISCARD uint32_t gaia::ecs::detail::NonFragmentingRelationStore::source_count ( ) const
inline

Returns the number of active source bindings.

Returns
Number of bound source entities.

◆ sources()

GAIA_NODISCARD const cnt::darray< Entity > * gaia::ecs::detail::NonFragmentingRelationStore::sources ( Entity  target) const
inline

Returns sources currently bound to target.

Parameters
targetTarget entity.
Returns
Source bucket or nullptr when no source is bound.

◆ target()

GAIA_NODISCARD Entity gaia::ecs::detail::NonFragmentingRelationStore::target ( Entity  source) const
inline

Returns the target currently bound to source.

Parameters
sourceSource entity.
Returns
Bound target or EntityBad when no binding exists.

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