|
|
| World (World &&)=delete |
| |
|
| World (const World &)=delete |
| |
|
World & | operator= (World &&)=delete |
| |
|
World & | operator= (const World &)=delete |
| |
| template<bool UseCache = true> |
| auto | query () |
| | Provides a query set up to work with the parent world.
|
| |
|
GAIA_NODISCARD EntityContainer & | fetch (Entity entity) |
| |
|
GAIA_NODISCARD const EntityContainer & | fetch (Entity entity) const |
| |
|
void | set_serializer (ser::ISerializer *pSerializer) |
| |
|
ser::ISerializer * | get_serializer () const |
| |
|
GAIA_NODISCARD ComponentCache & | comp_cache_mut () |
| |
|
GAIA_NODISCARD const ComponentCache & | comp_cache () const |
| |
|
GAIA_NODISCARD QuerySerMap & | query_ser_map () |
| |
| 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.
|
| |
|
template<typename T > |
| GAIA_NODISCARD Entity | get () const |
| |
| 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.
|
| |
| 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.
|
| |
| void | add (Entity entity, Entity object) |
| | Attaches entity object to entity entity.
|
| |
| void | add (Entity entity, Pair pair) |
| | Creates a new entity relationship pair.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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 TriggerHooks is true, also triggers the component's set hooks.
|
| |
| GAIA_NODISCARD ComponentSetter | acc_mut (Entity entity) |
| | Starts a bulk set operation on entity.
|
| |
| template<typename T > |
| GAIA_NODISCARD decltype(auto) | set (Entity entity) |
| | Sets the value of the component T on entity.
|
| |
| 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.
|
| |
| template<typename T > |
| GAIA_NODISCARD decltype(auto) | mut (Entity entity) |
| | Sets the value of the component T on entity without triggering a world version update.
|
| |
| 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.
|
| |
| 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 (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 const char * | name (Entity entity) const |
| | Returns the name assigned to entity.
|
| |
| GAIA_NODISCARD const char * | name (EntityId entityId) const |
| | Returns the name assigned to entityId.
|
| |
| GAIA_NODISCARD Entity | get (const char *name, uint32_t len=0) const |
| | Returns the entity that is assigned a name name. If the name contains the character '.' hierarchical lookup is use. E.g. "parent.child.subchild" will return the entity for subchild is the entire tree could be found by name.
|
| |
|
GAIA_NODISCARD Entity | get_inter (const char *name, uint32_t len=0) const |
| |
| 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.
|
| |
|
template<typename Func > |
| void | as_relations_trav (Entity target, Func func) const |
| |
|
template<typename Func > |
| GAIA_NODISCARD bool | as_relations_trav_if (Entity target, Func func) const |
| |
| 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.
|
| |
|
template<typename Func > |
| void | as_targets_trav (Entity relation, Func func) const |
| |
|
template<typename Func > |
| bool | as_targets_trav_if (Entity relation, Func func) const |
| |
|
CommandBufferST & | cmd_buffer_st () const |
| |
|
CommandBufferMT & | cmd_buffer_mt () const |
| |
| void | enable (Entity entity, bool enable) |
| | Enables or disables an entire entity.
|
| |
| GAIA_NODISCARD bool | enabled (Entity entity) const |
| | Checks if an entity is enabled.
|
| |
| 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.
|
| |
| GAIA_NODISCARD uint32_t & | world_version () |
| | Returns the current version of the world.
|
| |
| 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 | 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.
|
| |
|
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(BinarySerializer& s)" 2) free function in gaia::ser namespace: "void tag_invoke(gaia::ser::save_v, BinarySerializer& s,
const YourType& data)".
|
| |
|
bool | load (ser::ISerializer *pOutputSerializer=nullptr) |
| | 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 save(BinarySerializer& s)" 2) free function in gaia::ser namespace: "void tag_invoke(gaia::ser::load_v, BinarySerializer& s,
YourType& data)".
|
| |
|
QuerySerBuffer & | query_buffer (QueryId &serId) |
| |
|
void | query_buffer_reset (QueryId &serId) |
| |
|
void | invalidate_queries_for_entity (Pair is_pair) |
| |
|
Entity | name_to_entity (std::span< const char > exprRaw) const |
| |
|
Entity | expr_to_entity (va_list &args, std::span< const char > exprRaw) const |
| |