|
|
| World (World &&)=delete |
| |
|
| World (const World &)=delete |
| |
|
World & | operator= (World &&)=delete |
| |
|
World & | operator= (const World &)=delete |
| |
| Query | query () |
| | Provides a cached query set up to work with the parent world. Cached queries use local scope by default.
|
| |
| Query | uquery () |
| | Provides an uncached query set up to work with the parent world. Uncached queries keep only a local immutable plan and rebuild transient matches on demand.
|
| |
| GAIA_NODISCARD EntityContainer & | fetch (Entity entity) |
| | Returns the internal record for entity.
|
| |
| GAIA_NODISCARD const EntityContainer & | fetch (Entity entity) const |
| | Returns the internal record for entity.
|
| |
| GAIA_NODISCARD bool | is_dont_fragment (Entity entity) const |
| | Returns whether entity is marked DontFragment.
|
| |
| GAIA_NODISCARD bool | is_dont_fragment_relation (Entity relation) const |
| | Returns whether relation is a valid non-fragmenting relation entity.
|
| |
| GAIA_NODISCARD bool | is_exclusive_dont_fragment_relation (Entity relation) const |
| | Returns whether relation is both Exclusive and DontFragment. Such relations are stored in the adjunct side structure instead of archetype identity.
|
| |
|
GAIA_NODISCARD bool | is_hierarchy_relation (Entity relation) const |
| | Returns true for hierarchy-like relations whose targets form an exclusive traversable parent chain. ChildOf and Parent satisfy this today. DependsOn intentionally does not.
|
| |
|
GAIA_NODISCARD bool | is_fragmenting_relation (Entity relation) const |
| | Returns true when the relation still participates in archetype identity. Non-fragmenting relations such as Parent are excluded.
|
| |
|
GAIA_NODISCARD bool | is_fragmenting_hierarchy_relation (Entity relation) const |
| | Returns true for hierarchy relations that still fragment archetypes. ChildOf satisfies this today, while Parent intentionally does not.
|
| |
|
GAIA_NODISCARD bool | supports_depth_order (Entity relation) const |
| | Returns true when the relation can drive cached depth-ordered iteration. This requires a fragmenting relation whose target participates in archetype identity, such as ChildOf, DependsOn, or a custom fragmenting relation. Cycles are still invalid and are diagnosed by the depth cache itself.
|
| |
|
GAIA_NODISCARD bool | depth_order_prunes_disabled_subtrees (Entity relation) const |
| | Returns true when depth-ordered iteration may safely prune disabled subtrees at archetype level. Only fragmenting hierarchy relations qualify because all rows in the archetype then share the same direct parent and therefore the same ancestor chain.
|
| |
| GAIA_NODISCARD bool | is_out_of_line_component (Entity component) const |
| | Returns whether component stores instance data out of line instead of in archetype chunks. This is currently the storage path used for sparse plain generic AoS components.
|
| |
| GAIA_NODISCARD bool | is_non_fragmenting_out_of_line_component (Entity component) const |
| | Returns whether component is both out-of-line and non-fragmenting. Non-fragmenting out-of-line components do not participate in archetype identity.
|
| |
| void | sync_component_record (Entity component, Component comp) |
| | Updates the cached component metadata in both the component cache and the core Component storage.
|
| |
| void | set_component_dont_fragment (Entity component, EntityContainer &ec) |
| | Latches DontFragment on a component entity record. This first moves the payload out of chunks, then removes the id from archetype identity.
|
| |
| void | set_component_sparse_storage (Entity component) |
| | Latches Sparse storage on a component entity before any instances exist. This moves the payload out of chunks while keeping the id in archetype identity. Only plain generic AoS components are supported.
|
| |
| template<typename T > |
| GAIA_NODISCARD bool | can_use_out_of_line_component (Entity object) const |
| | Returns whether object is a usable out-of-line storage target for component type T.
|
| |
| template<typename T > |
| GAIA_NODISCARD SparseComponentStore< T > * | sparse_component_store (Entity component) |
| | Returns the sparse out-of-line component store for component, or nullptr if it does not exist.
|
| |
| template<typename T > |
| GAIA_NODISCARD const SparseComponentStore< T > * | sparse_component_store (Entity component) const |
| | Returns the sparse out-of-line component store for component, or nullptr if it does not exist.
|
| |
| template<typename T > |
| GAIA_NODISCARD SparseComponentStore< T > & | sparse_component_store_mut (Entity component) |
| | Returns the sparse out-of-line component store for component, creating it if needed.
|
| |
| void | del_sparse_components (Entity entity) |
| | Removes all sparse out-of-line component instances owned by entity.
|
| |
| void | del_sparse_component_store (Entity component) |
| | Deletes the sparse out-of-line component store associated with component.
|
| |
| GAIA_NODISCARD const ExclusiveAdjunctStore * | exclusive_adjunct_store (Entity relation) const |
| | Returns the exclusive adjunct store for relation, or nullptr when absent.
|
| |
| GAIA_NODISCARD ExclusiveAdjunctStore & | exclusive_adjunct_store_mut (Entity relation) |
| | Returns the exclusive adjunct store for relation, creating it if needed.
|
| |
|
void | exclusive_adjunct_track_src_relation (Entity source, Entity relation) |
| |
|
void | exclusive_adjunct_untrack_src_relation (Entity source, Entity relation) |
| |
|
void | exclusive_adjunct_set (Entity source, Entity relation, Entity target) |
| |
|
bool | exclusive_adjunct_del (Entity source, Entity relation, Entity target) |
| |
|
GAIA_NODISCARD bool | has_exclusive_adjunct_pair (Entity source, Entity object) const |
| |
|
void | del_exclusive_adjunct_source (Entity source) |
| |
|
void | del_exclusive_adjunct_relation (Entity relation) |
| |
|
GAIA_NODISCARD bool | has_exclusive_adjunct_target_cond (Entity target, Pair cond) const |
| | Checks whether any non-fragmenting exclusive relation targeting target uses the given OnDeleteTarget rule.
|
| |
|
void | set_serializer (std::nullptr_t) |
| | Resets runtime serializer binding to the default internal bin_stream backend.
|
| |
| void | set_serializer (ser::serializer serializer) |
| | Binds a pre-built runtime serializer handle.
|
| |
| template<typename TSerializer > |
| void | set_serializer (TSerializer &serializer) |
| | Binds a concrete serializer object through ser::make_serializer().
|
| |
| ser::serializer | get_serializer () const |
| | Returns the currently bound runtime serializer handle.
|
| |
| GAIA_NODISCARD ComponentCache & | comp_cache_mut () |
| | Returns mutable access to the world component cache.
|
| |
| GAIA_NODISCARD const ComponentCache & | comp_cache () const |
| | Returns read-only access to the world component cache.
|
| |
| GAIA_NODISCARD Entity | symbol (const char *symbol, uint32_t len=0) const |
| | Finds a component entity by its exact registered symbol.
|
| |
| GAIA_NODISCARD util::str_view | symbol (Entity component) const |
| | Returns the registered symbol name for a component entity.
|
| |
| GAIA_NODISCARD Entity | path (const char *path, uint32_t len=0) const |
| | Finds a component entity by its exact scoped path.
|
| |
| GAIA_NODISCARD util::str_view | path (Entity component) const |
| | Returns the scoped path name for a component entity.
|
| |
| bool | path (Entity component, const char *path, uint32_t len=0) |
| | Assigns a scoped path name to a component entity.
|
| |
| GAIA_NODISCARD Entity | alias (const char *alias, uint32_t len=0) const |
| | Finds an entity by its exact alias.
|
| |
| GAIA_NODISCARD util::str_view | alias (Entity entity) const |
| | Returns the alias assigned to an entity.
|
| |
| bool | alias (Entity entity, const char *alias, uint32_t len=0) |
| | Assigns an alias name to an entity.
|
| |
| bool | alias_raw (Entity entity, const char *alias, uint32_t len=0) |
| | Assigns an alias name to an entity without copying the string.
|
| |
| GAIA_NODISCARD util::str_view | display_name (Entity entity) const |
| | Returns the preferred display name for a entity. This is intended for diagnostics and other pretty output, not as a stable identity key.
|
| |
| GAIA_NODISCARD bool | valid (Entity entity) const |
| | Checks if entity is valid.
|
| |
| GAIA_NODISCARD Entity | get (EntityId id) const |
| | Returns the entity located at the index id.
|
| |
|
GAIA_NODISCARD Entity | try_get (EntityId id) const |
| | Returns the entity for id when it is still live, or EntityBad for stale cleanup-time ids.
|
| |
| template<typename T > |
| GAIA_NODISCARD Entity | get () const |
| | Returns the entity registered for component type T.
|
| |
| template<typename T > |
| GAIA_NODISCARD const ComponentCacheItem & | reg_comp () |
| | Returns the registered component cache item for T, auto-registering it when enabled.
|
| |
| EntityBuilder | build (Entity entity) |
| | Starts a bulk add/remove operation on entity.
|
| |
| GAIA_NODISCARD Entity | add (EntityKind kind=EntityKind::EK_Gen) |
| | Creates a new empty entity.
|
| |
| GAIA_NODISCARD Entity | prefab (EntityKind kind=EntityKind::EK_Gen) |
| | Creates a new prefab entity.
|
| |
| template<typename Func = TFunc_Void_With_Entity> |
| void | add_n (uint32_t count, Func func=func_void_with_entity) |
| | Creates count new empty entities.
|
| |
| template<typename Func = TFunc_Void_With_Entity> |
| void | add_n (Entity entity, uint32_t count, Func func=func_void_with_entity) |
| | Creates count of entities of the same archetype as entity.
|
| |
| template<typename T > |
| GAIA_NODISCARD const ComponentCacheItem & | add () |
| | Creates a new component if not found already.
|
| |
| GAIA_NODISCARD const ComponentCacheItem & | add (const char *name, uint32_t size, DataStorageType storageType, uint32_t alig=1, uint32_t soa=0, const uint8_t *pSoaSizes=nullptr, ComponentLookupHash hashLookup={}, EntityKind kind=EntityKind::EK_Gen) |
| | Creates a new runtime component if not found already.
|
| |
| void | add (Entity entity, Entity object) |
| | Attaches entity object to entity entity.
|
| |
| void | add (Entity entity, Pair pair) |
| | Attaches a relationship pair to entity.
|
| |
| template<typename T > |
| void | add (Entity entity) |
| | Attaches a new component T to entity.
|
| |
| template<typename T > |
| void | add (Entity entity, Entity object, T &&value) |
| | Attaches object to entity. Also sets its value.
|
| |
| template<typename T , typename U = typename actual_type_t<T>::Type> |
| void | add (Entity entity, U &&value) |
| | Attaches a new component T to entity. Also sets its value.
|
| |
| GAIA_NODISCARD bool | override (Entity entity, Entity object) |
| | Materializes an inherited id as directly owned storage on entity.
|
| |
| GAIA_NODISCARD bool | override (Entity entity, Pair pair) |
| | Materializes an inherited pair as directly owned storage on entity.
|
| |
| template<typename T > |
| GAIA_NODISCARD bool | override (Entity entity) |
| | Materializes an inherited typed component as directly owned storage on entity.
|
| |
| template<typename T > |
| GAIA_NODISCARD bool | override (Entity entity, Entity object) |
| | Materializes an inherited typed component associated with object on entity.
|
| |
| void | clear (Entity entity) |
| | Removes any component or entity attached to entity.
|
| |
| GAIA_NODISCARD Entity | copy (Entity srcEntity) |
| | Creates a new entity by cloning an already existing one. Does not trigger observers.
|
| |
| template<typename Func = TFunc_Void_With_Entity> |
| void | copy_n (Entity entity, uint32_t count, Func func=func_void_with_entity) |
| | Creates count new entities by cloning an already existing one.
|
| |
|
GAIA_NODISCARD Entity | instantiate (Entity prefabEntity) |
| | Instantiates a prefab as a normal entity. The instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, and adds a direct Pair(Is, prefabEntity) edge instead.
|
| |
|
GAIA_NODISCARD Entity | instantiate (Entity prefabEntity, Entity parentInstance) |
| | Instantiates a prefab as a normal entity parented under parentInstance. The instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, adds a direct Pair(Is, prefabEntity) edge instead, and attaches Pair(Parent, parentInstance) to the new root instance.
|
| |
| template<typename Func = TFunc_Void_With_Entity> |
| void | instantiate_n (Entity prefabEntity, uint32_t count, Func func=func_void_with_entity) |
| | Instantiates count copies of a prefab as normal entities. The instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, adds a direct Pair(Is, prefabEntity) edge instead, and attaches Pair(Parent, parentInstance) to the new root instance.
|
| |
|
void | instantiate_n (Entity prefabEntity, Entity parentInstance, uint32_t count) |
| | Instantiates count copies of a prefab as normal entities parented under parentInstance.
|
| |
|
template<typename Func > |
| void | instantiate_n (Entity prefabEntity, Entity parentInstance, uint32_t count, Func func) |
| | Instantiates count copies of a prefab as normal entities parented under parentInstance. The callback is invoked for each spawned root instance.
|
| |
|
GAIA_NODISCARD uint32_t | sync (Entity prefabEntity) |
| | Propagates additive prefab changes to existing non-prefab instances. Missing copied ids are added to existing instances and missing prefab children are spawned. Existing owned instance data is left intact.
|
| |
| void | del (Entity entity) |
| | Removes an entity along with all data associated with it.
|
| |
| void | del (Entity entity, Entity object) |
| | Removes an object from entity if possible.
|
| |
| void | del (Entity entity, Pair pair) |
| | Removes an existing entity relationship pair.
|
| |
| template<typename T > |
| void | del (Entity entity) |
| | Removes a component T from entity.
|
| |
|
void | as (Entity entity, Entity entityBase) |
| | Shortcut for add(entity, Pair(Is, entityBase)
|
| |
| GAIA_NODISCARD bool | is (Entity entity, Entity entityBase) const |
| | Checks if entity inherits from entityBase.
|
| |
| GAIA_NODISCARD bool | in (Entity entity, Entity entityBase) const |
| | Checks if entity is located in entityBase. This is almost the same as "is" with the exception that false is returned if entity matches entityBase.
|
| |
|
GAIA_NODISCARD bool | is_base (Entity target) const |
| |
|
void | child (Entity entity, Entity parent) |
| | Shortcut for add(entity, Pair(ChildOf, parent)
|
| |
| GAIA_NODISCARD bool | child (Entity entity, Entity parent) const |
| | Checks if.
|
| |
|
void | parent (Entity entity, Entity parentEntity) |
| | Shortcut for add(entity, Pair(Parent, parent))
|
| |
| GAIA_NODISCARD bool | parent (Entity entity, Entity parentEntity) const |
| | Checks if.
|
| |
| template<typename T > |
| void | modify (Entity entity) |
| | Marks the component T as modified. Best used with acc_mut().sset() or set() to manually trigger an update at user's whim. If TriggerSetEffects is true, also triggers the component's set side effects: set hooks and OnSet observers.
|
| |
| template<typename T > |
| void | modify (Entity entity, Entity object) |
| | Marks the component associated with object as modified on entity. Best used with mut<T>(entity, object) or sset<T>(entity, object) to manually trigger an update at user's whim. If TriggerSetEffects is true, also triggers the component's set side effects: set hooks and OnSet observers.
|
| |
| GAIA_NODISCARD ComponentSetter | acc_mut (Entity entity) |
| | Starts a bulk set operation on entity.
|
| |
| template<typename T > |
| GAIA_NODISCARD auto | set (Entity entity) |
| | Returns a write-back proxy for the component T on entity. The proxy copies the current value, lets the caller mutate it, then writes it back at the end of the full expression or scope. OnSet observers and chunk-backed set hooks are triggered only after the write-back completes.
|
| |
| template<typename T > |
| GAIA_NODISCARD auto | set (Entity entity, Entity object) |
| | Returns a write-back proxy for the component associated with object on entity. The proxy copies the current value, lets the caller mutate it, then writes it back at the end of the full expression or scope. OnSet observers and chunk-backed set hooks are triggered only after the write-back completes.
|
| |
| template<typename T > |
| GAIA_NODISCARD decltype(auto) | sset (Entity entity) |
| | Sets the value of the component T on entity without triggering a world version update. This is a silent write and does not trigger set hooks or OnSet observers.
|
| |
|
template<typename T > |
| GAIA_NODISCARD decltype(auto) | sset (Entity entity, Entity object) |
| | Sets the value of the component associated with object on entity without updating world version. This is a silent write and does not trigger set hooks or OnSet observers.
|
| |
| template<typename T > |
| GAIA_NODISCARD decltype(auto) | mut (Entity entity) |
| | Returns a mutable reference or proxy to the component on entity without triggering a world version update. This is a silent raw write path. Call modify<T, true>(entity) when you need hooks or OnSet.
|
| |
|
template<typename T > |
| GAIA_NODISCARD decltype(auto) | mut (Entity entity, Entity object) |
| | Returns a mutable reference or proxy to the component associated with object on entity. This is a silent raw write path. Call modify<T, true>(entity, object) when you need hooks or OnSet.
|
| |
| ComponentGetter | acc (Entity entity) const |
| | Starts a bulk get operation on an entity.
|
| |
| template<typename T > |
| GAIA_NODISCARD decltype(auto) | get (Entity entity) const |
| | Returns the value stored in the component T on entity.
|
| |
|
template<typename T > |
| GAIA_NODISCARD decltype(auto) | get (Entity entity, Entity object) const |
| | Returns the value stored in the component associated with object on entity.
|
| |
| GAIA_NODISCARD bool | has (Entity entity) const |
| | Checks if entity is currently used by the world.
|
| |
| GAIA_NODISCARD bool | has (Pair pair) const |
| | Checks if pair is currently used by the world.
|
| |
| GAIA_NODISCARD bool | has (Entity entity, Entity object) const |
| | Checks if entity contains the entity object.
|
| |
| GAIA_NODISCARD bool | has_direct (Entity entity, Entity object) const |
| | Checks if entity directly contains the entity object, without semantic inheritance expansion.
|
| |
|
GAIA_NODISCARD bool | has_direct (Entity entity, Pair pair) const |
| | Checks if entity directly contains pair, without semantic inheritance expansion.
|
| |
| GAIA_NODISCARD std::span< const Entity > | lookup_path () const |
| | Returns the ordered component lookup path used for unqualified component lookup. Each scope is searched like a temporary component scope: the scope first, then its parents.
|
| |
| void | lookup_path (std::span< const Entity > scopes) |
| | Replaces the ordered component lookup path used for unqualified component lookup. Each scope is searched in the order provided, and each scope walk includes its parents.
|
| |
| GAIA_NODISCARD Entity | scope () const |
| | Returns the current component scope used for component registration and relative component lookup.
|
| |
| Entity | scope (Entity scope) |
| | Sets the current component scope used for component registration and relative component lookup. The scope entity and its ChildOf ancestors are expected to have names so we can build a path from them.
|
| |
| template<typename Func > |
| void | scope (Entity scopeEntity, Func &&func) |
| | Executes func with a temporary component scope and restores the previous scope afterwards. Relative component lookup walks up the ChildOf hierarchy of the active scope. The scope entity and its ChildOf ancestors are expected to have names so we can build a path from them.
|
| |
| Entity | module (const char *path, uint32_t len=0) |
| | Finds or builds a named module hierarchy and returns the deepest scope entity. Each path segment is mapped to an entity name and connected with ChildOf relationships.
|
| |
| GAIA_NODISCARD bool | has (Entity entity, Pair pair) const |
| | Checks if entity contains pair.
|
| |
| template<typename T > |
| GAIA_NODISCARD bool | has (Entity entity) const |
| | Checks if entity contains the component T.
|
| |
| void | name (Entity entity, const char *name, uint32_t len=0) |
| | Assigns a name to entity. Ignored if used with pair. The string is copied and kept internally.
|
| |
| void | name_raw (Entity entity, const char *name, uint32_t len=0) |
| | Assigns a name to entity. Ignored if used with pair. The string is NOT copied. Your are responsible for its lifetime.
|
| |
| GAIA_NODISCARD util::str_view | name (Entity entity) const |
| | Returns the name assigned to entity.
|
| |
| GAIA_NODISCARD util::str_view | name (EntityId entityId) const |
| | Returns the entity name assigned to entityId.
|
| |
| GAIA_NODISCARD Entity | resolve (const char *name, uint32_t len=0) const |
| | Resolves name in the world naming system. Entity names and hierarchical entity paths are attempted first. If they do not match, component lookup uses the current scope, then the lookup path, then global component symbol, path and alias lookup.
|
| |
| void | resolve (cnt::darray< Entity > &out, const char *name, uint32_t len=0) const |
| | Collects every entity and component entity that matches name. This is useful for diagnostics when a short lookup could refer to multiple scoped components.
|
| |
| GAIA_NODISCARD Entity | get (const char *name, uint32_t len=0) const |
| | Returns the entity assigned a name name. This is a convenience alias for resolve(name).
|
| |
| GAIA_NODISCARD const cnt::set< EntityLookupKey > * | relations (Entity target) const |
| | Returns relations for target.
|
| |
| GAIA_NODISCARD Entity | relation (Entity entity, Entity target) const |
| | Returns the first relationship relation for the target entity on entity.
|
| |
| template<typename Func > |
| void | relations (Entity entity, Entity target, Func func) const |
| | Returns the relationship relations for the target entity on entity.
|
| |
| template<typename Func > |
| void | relations_if (Entity entity, Entity target, Func func) const |
| | Returns the relationship relations for the target entity on entity.
|
| |
| GAIA_NODISCARD const cnt::darray< Entity > & | as_relations_trav_cache (Entity target) const |
| | Returns the cached transitive Is descendants for a target entity. The cache is rebuilt lazily and cleared whenever an Is edge changes.
|
| |
| GAIA_NODISCARD const cnt::darray< Entity > & | as_targets_trav_cache (Entity relation) const |
| | Returns the cached transitive Is targets for a relation entity. The cache is rebuilt lazily and cleared whenever an Is edge changes.
|
| |
|
GAIA_NODISCARD const cnt::darray< Entity > & | targets_trav_cache (Entity relation, Entity source) const |
| | Returns the cached unlimited upward traversal chain for (relation, source). The cache excludes the source entity itself and is cleared whenever a pair edge changes.
|
| |
|
GAIA_NODISCARD const cnt::darray< Entity > & | targets_all_cache (Entity source) const |
| | Returns the cached deduped direct targets for wildcard target traversal on source. The cache is keyed by source and cleared whenever a pair edge changes.
|
| |
|
GAIA_NODISCARD const cnt::darray< Entity > & | sources_all_cache (Entity target) const |
| | Returns the cached deduped direct sources for wildcard source traversal on target. The cache is keyed by target and cleared whenever a pair edge changes.
|
| |
|
template<typename Func > |
| void | targets_trav (Entity relation, Entity source, Func func) const |
| | Traverses relationship targets upwards starting from source. Disabled entities act as traversal barriers and are not yielded.
|
| |
| template<typename Func > |
| GAIA_NODISCARD bool | targets_trav_if (Entity relation, Entity source, Func func) const |
| | Traverses relationship targets upwards starting from source. Disabled entities act as traversal barriers and are not yielded.
|
| |
|
GAIA_NODISCARD const cnt::darray< Entity > & | sources_bfs_trav_cache (Entity relation, Entity rootTarget) const |
| | Returns the cached unlimited breadth-first descendant traversal for (relation, rootTarget). The cache excludes the root target itself and is cleared whenever a pair edge changes.
|
| |
|
GAIA_NODISCARD uint32_t | depth_order_cache (Entity relation, Entity sourceTarget) const |
| | Returns the cached fragmenting relation depth used by depth-ordered iteration for (relation, target). The returned value is 1 for direct dependents of a root/source with no further relation targets and grows by one per level. For multi-target relations, the deepest target chain determines the result.
|
| |
| template<typename Func > |
| void | as_relations_trav (Entity target, Func func) const |
| | Traverses transitive Is descendants of target. The traversal uses the cached closure built by as_relations_trav_cache().
|
| |
| template<typename Func > |
| GAIA_NODISCARD bool | as_relations_trav_if (Entity target, Func func) const |
| | Traverses transitive Is descendants of target until func returns true.
|
| |
| GAIA_NODISCARD const cnt::set< EntityLookupKey > * | targets (Entity relation) const |
| | Returns targets for relation.
|
| |
| GAIA_NODISCARD Entity | target (Entity entity, Entity relation) const |
| | Returns the first relationship target for the relation entity on entity.
|
| |
| template<typename Func > |
| void | targets (Entity entity, Entity relation, Func func) const |
| | Returns the relationship targets for the relation entity on entity.
|
| |
| template<typename Func > |
| void | targets_if (Entity entity, Entity relation, Func func) const |
| | Returns the relationship targets for the relation entity on entity.
|
| |
|
GAIA_NODISCARD Entity | pair_target_if_alive (Entity pair) const |
| | Resolves the target of an archetype-stored exact pair id, skipping stale cleanup-time targets.
|
| |
| template<typename Func > |
| void | sources (Entity relation, Entity target, Func func) const |
| | Returns relationship sources for the relation and target.
|
| |
| template<typename Func > |
| void | sources_if (Entity relation, Entity target, Func func) const |
| | Returns relationship sources for the relation and target.
|
| |
| GAIA_NODISCARD uint32_t | count_direct_term_entities (Entity term) const |
| | Counts entities directly matching term, including semantic Is inheritance expansion.
|
| |
| GAIA_NODISCARD uint32_t | count_direct_term_entities_direct (Entity term) const |
| | Counts entities directly matching term without semantic Is expansion.
|
| |
| void | collect_direct_term_entities (Entity term, cnt::darray< Entity > &out) const |
| | Appends entities directly matching term to out, including semantic Is expansion.
|
| |
| void | collect_direct_term_entities_direct (Entity term, cnt::darray< Entity > &out) const |
| | Appends entities directly matching term to out without semantic Is expansion.
|
| |
| GAIA_NODISCARD bool | for_each_direct_term_entity (Entity term, void *ctx, bool(*func)(void *, Entity)) const |
| | Visits entities directly matching term, including semantic Is expansion.
|
| |
| GAIA_NODISCARD bool | for_each_direct_term_entity_direct (Entity term, void *ctx, bool(*func)(void *, Entity)) const |
| | Visits entities directly matching term without semantic Is expansion.
|
| |
| template<typename Func > |
| void | sources_bfs (Entity relation, Entity rootTarget, Func func) const |
| | Traverses relationship sources in breadth-first order. Starting at rootTarget, this visits all direct sources first and then deeper levels.
|
| |
| template<typename Func > |
| GAIA_NODISCARD bool | sources_bfs_if (Entity relation, Entity rootTarget, Func func) const |
| | Traverses relationship sources in breadth-first order. Starting at rootTarget, this visits all direct sources first and then deeper levels.
|
| |
| template<typename Func > |
| void | children (Entity parent, Func func) const |
| | Visits direct children in the ChildOf hierarchy.
|
| |
| template<typename Func > |
| void | children_if (Entity parent, Func func) const |
| | Visits direct children in the ChildOf hierarchy until func returns false.
|
| |
| template<typename Func > |
| void | children_bfs (Entity root, Func func) const |
| | Traverses descendants in the ChildOf hierarchy in breadth-first order.
|
| |
| template<typename Func > |
| GAIA_NODISCARD bool | children_bfs_if (Entity root, Func func) const |
| | Traverses descendants in the ChildOf hierarchy in breadth-first order.
|
| |
| template<typename Func > |
| void | as_targets_trav (Entity relation, Func func) const |
| | Traverses transitive Is targets of relation. The traversal uses the cached closure built by as_targets_trav_cache().
|
| |
| template<typename Func > |
| bool | as_targets_trav_if (Entity relation, Func func) const |
| | Traverses transitive Is targets of relation until func returns true.
|
| |
| CommandBufferST & | cmd_buffer_st () const |
| | Returns the single-threaded deferred command buffer owned by the world.
|
| |
| CommandBufferMT & | cmd_buffer_mt () const |
| | Returns the multi-thread-safe deferred command buffer owned by the world.
|
| |
| void | enable (Entity entity, bool enable) |
| | Enables or disables an entire entity.
|
| |
| GAIA_NODISCARD bool | enabled (const EntityContainer &ec) const |
| | Checks if an entity is enabled.
|
| |
| GAIA_NODISCARD bool | enabled (Entity entity) const |
| | Checks if an entity is enabled.
|
| |
|
GAIA_NODISCARD bool | enabled_hierarchy (Entity entity, Entity relation) const |
| | Checks whether an entity is enabled together with all of its ancestors reachable through relation. This keeps direct enabled state separate from hierarchy-aware gating.
|
| |
| GAIA_NODISCARD Chunk * | get_chunk (Entity entity) const |
| | Returns a chunk containing the entity.
|
| |
| GAIA_NODISCARD Chunk * | get_chunk (Entity entity, uint32_t &row) const |
| | Returns a chunk containing the entity. Index of the entity is stored in row.
|
| |
| GAIA_NODISCARD uint32_t | size () const |
| | Returns the number of active entities.
|
| |
|
void | runtime_counters (uint32_t &outArchetypes, uint32_t &outChunks, uint32_t &outEntitiesTotal, uint32_t &outEntitiesActive) const |
| | Returns high-level runtime counters useful for diagnostics/telemetry.
|
| |
| GAIA_NODISCARD uint32_t & | world_version () |
| | Returns the current version of the world.
|
| |
|
GAIA_NODISCARD uint32_t | rel_version (Entity relation) const |
| | Returns structural version for a given relation. Increments whenever any Pair(relation, *) is added or removed on any entity.
|
| |
| GAIA_NODISCARD uint32_t | enabled_hierarchy_version () const |
| | Returns the version that changes when entity enabled state changes. Hierarchy-aware cached traversals use this to invalidate ancestor gating state.
|
| |
|
void | update_src_entity_version (Entity entity) |
| | Updates a tracked source-entity version after the entity changes archetype membership.
|
| |
|
void | remove_src_entity_version (Entity entity) |
| | Removes sparse source-version state for an entity that is being destroyed.
|
| |
| void | set_max_lifespan (Entity entity, uint32_t lifespan=Archetype::MAX_ARCHETYPE_LIFESPAN) |
| | Sets maximal lifespan of an archetype entity belongs to.
|
| |
|
void | update () |
| | Performs various internal operations related to the end of the frame such as memory cleanup and other management operations which keep the system healthy.
|
| |
|
void | teardown () |
| | Performs world shutdown maintenance without running systems or observers. Runtime callbacks are shut down in-place first, then deferred entity/chunk/archetype cleanup is drained until no more pending teardown work remains.
|
| |
|
void | cleanup () |
| | Clears the world so that all its entities and components are released.
|
| |
| void | defrag_entities_per_tick (uint32_t value) |
| | Sets the maximum number of entities defragmented per world tick.
|
| |
|
void | diag_archetypes () const |
| | Performs diagnostics on archetypes. Prints basic info about them and the chunks they contain.
|
| |
|
void | diag_components () const |
| | Performs diagnostics on registered components. Prints basic info about them and reports and detected issues.
|
| |
|
void | diag_entities () const |
| | Performs diagnostics on entities of the world. Also performs validation of internal structures which hold the entities.
|
| |
|
void | diag () const |
| | Performs all diagnostics.
|
| |
|
GAIA_NODISCARD bool | locked () const |
| | Checks if the chunk is locked for structural changes.
|
| |
|
GAIA_NODISCARD bool | tearing_down () const |
| | Returns true while the world is draining teardown work and normal runtime callbacks must not execute.
|
| |
|
void | save () |
| | Saves contents of the world to a buffer. The buffer is reset, not appended. NOTE: In order for custom version of save to be used for a given component, it needs to have either of the following functions defined: 1) member function: "void save(bin_stream& s)" 2) free function in gaia::ser namespace: "void tag_invoke(gaia::ser::save_v, bin_stream& s,
const YourType& data)".
|
| |
|
bool | save_json (ser::ser_json &writer, ser::JsonSaveFlags flags=ser::JsonSaveFlags::Default) const |
| | Serializes world state into a JSON document. Components with runtime schema are emitted as structured JSON objects. Components with no schema fallback to raw serialized bytes. Returns false when some schema field types are unsupported (those fields are emitted as null).
|
| |
|
ser::json_str | save_json (bool &ok, ser::JsonSaveFlags flags=ser::JsonSaveFlags::Default) const |
| | Convenience overload returning JSON as a string.
|
| |
| bool | load_json (const char *json, uint32_t len, ser::JsonDiagnostics &diagnostics) |
| | Loads world state from JSON previously emitted by save_json(). Returns true when JSON shape is valid and parsing succeeds. Non-fatal semantic issues are reported through diagnostics.
|
| |
| bool | load_json (const char *json, uint32_t len) |
| | Loads world state from a raw JSON buffer and discards non-fatal diagnostics.
|
| |
| bool | load_json (ser::json_str_view json, ser::JsonDiagnostics &diagnostics) |
| | Loads world state from a JSON string view and reports non-fatal diagnostics.
|
| |
| bool | load_json (ser::json_str_view json) |
| | Loads world state from a JSON string view and discards non-fatal diagnostics.
|
| |
|
bool | load (ser::serializer inputSerializer={}) |
| | Loads a world state from a buffer. The buffer is sought to 0 before any loading happens. NOTE: In order for custom version of load to be used for a given component, it needs to have either of the following functions defined: 1) member function: "void load(bin_stream& s)" 2) free function in gaia::ser namespace: "void tag_invoke(gaia::ser::load_v, bin_stream& s,
YourType& data)".
|
| |
| template<typename TSerializer > |
| bool | load (TSerializer &inputSerializer) |
| | Loads a world state from a serializer-compatible stream wrapper.
|
| |
| QuerySerBuffer & | query_buffer (QueryId &serId) |
| | Returns the temporary serialization buffer used while building a query. A fresh query id is allocated lazily when serId is QueryIdBad.
|
| |
| void | query_buffer_reset (QueryId &serId) |
| | Releases the temporary serialization buffer associated with serId.
|
| |
| void | invalidate_queries_for_structural_entity (EntityLookupKey entityKey) |
| | Invalidates cached queries structurally affected by entityKey.
|
| |
| void | invalidate_queries_for_rel (Entity relation) |
| | Invalidates cached queries whose dynamic result depends on relation.
|
| |
| void | invalidate_sorted_queries_for_entity (Entity entity) |
| | Invalidates cached sorted queries whose row ordering depends on entity.
|
| |
|
void | invalidate_sorted_queries () |
| | Invalidates all cached sorted queries after row-order changes.
|
| |
| void | invalidate_queries_for_entity (Pair is_pair) |
| | Invalidates semantic Is queries affected by removing or changing is_pair.
|
| |
| Entity | name_to_entity (std::span< const char > exprRaw) const |
| | Resolves a textual id expression to an entity. Supports names, aliases, wildcard *, and pair expressions like (Rel, Target).
|
| |
| Entity | expr_to_entity (va_list &args, std::span< const char > exprRaw) const |
| | Resolves a textual id expression with e placeholders to an entity. Supports the same pair and wildcard syntax as name_to_entity().
|
| |