![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Applies structural and value changes to one entity. More...
#include <world.h>
Public Types | |
| using | RelationMutationPath = detail::RelationMutationPath |
| Mutation path selected for fragmenting or non-fragmenting relation updates. | |
Public Member Functions | |
| EntityBuilder (World &world, Entity entity, EntityContainer &ec) | |
| Creates a builder from an already fetched entity record. | |
| EntityBuilder (World &world, Entity entity) | |
| Creates a builder and fetches the entity's current storage record. | |
| EntityBuilder (const EntityBuilder &)=default | |
| EntityBuilder & | operator= (const EntityBuilder &)=delete |
| EntityBuilder & | operator= (EntityBuilder &&)=delete |
| void | commit () |
| Commits all gathered changes and performs an archetype movement. | |
| void | name (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 (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. | |
| void | alias (const char *alias, uint32_t len=0) |
| Assigns an alias to entity. Ignored if used with pair. The string is copied and kept internally. | |
| void | alias_raw (const char *alias, uint32_t len=0) |
| Assigns an alias to entity. Ignored if used with pair. The string is NOT copied. You are responsible for its lifetime. | |
| void | del_name () |
| Removes any name associated with the entity. | |
| void | del_alias () |
| Removes any alias associated with the entity. | |
| EntityBuilder & | add (Entity entity) |
| Prepares an archetype movement by following the "add" edge of the current archetype. | |
| EntityBuilder & | add (Pair pair) |
| Prepares an archetype movement by following the "add" edge of the current archetype. | |
| EntityBuilder & | as (Entity entityBase) |
Shortcut for add(Pair(Is, entityBase)). Effectively makes an entity inherit from entityBase. | |
| EntityBuilder & | prefab () |
| Marks the entity as a prefab. | |
| GAIA_NODISCARD bool | as (Entity entity, Entity entityBase) const |
Check if entity inherits from entityBase. | |
| EntityBuilder & | child (Entity parent) |
| Shortcut for add(Pair(ChildOf, parent)) | |
| template<typename T > | |
| Entity | register_component () |
Takes care of registering the component type used by T. | |
| template<typename T > | |
| EntityBuilder & | add () |
| Adds the registered component or pair type to the pending entity state. | |
| EntityBuilder & | del (Entity entity) |
| Prepares an archetype movement by following the "del" edge of the current archetype. | |
| EntityBuilder & | del (Pair pair) |
| Prepares an archetype movement by following the "del" edge of the current archetype. | |
| template<typename T > | |
| EntityBuilder & | del () |
| Removes the registered component or pair type from the pending entity state. | |
Public Attributes | |
| World & | m_world |
| World receiving the accumulated entity changes. | |
| Archetype * | m_pArchetypeSrc = nullptr |
| Original archetype m_entity belongs to. | |
| Chunk * | m_pChunkSrc = nullptr |
| Original chunk m_entity belonged to. | |
| uint32_t | m_rowSrc = 0 |
| Original row. | |
| Archetype * | m_pArchetype = nullptr |
| Target archetype we want to move to. | |
| EntityNameLookupKey | m_targetNameKey |
| Target name. | |
| EntityNameLookupKey | m_targetAliasKey |
| Target alias string pointer. | |
| Entity | m_entity |
| Source entity. | |
Friends | |
| class | World |
Applies structural and value changes to one entity.
|
inline |
Adds the registered component or pair type to the pending entity state.
| T | Component or pair type to add. |
|
inline |
Prepares an archetype movement by following the "add" edge of the current archetype.
| entity | Added entity |
|
inline |
Prepares an archetype movement by following the "add" edge of the current archetype.
| pair | Relationship pair |
|
inline |
Assigns an alias to entity. Ignored if used with pair. The string is copied and kept internally.
| alias | A null-terminated string. |
| len | String length. If zero, the length is calculated. |
|
inline |
Assigns an alias to entity. Ignored if used with pair. The string is NOT copied. You are responsible for its lifetime.
| alias | Pointer to a stable null-terminated string. |
| len | String length. If zero, the length is calculated. |
|
inline |
Check if entity inherits from entityBase.
| entity | Source entity |
| entityBase | Base entity |
|
inline |
Shortcut for add(Pair(Is, entityBase)). Effectively makes an entity inherit from entityBase.
| entityBase | Entity to inherit from |
|
inline |
Shortcut for add(Pair(ChildOf, parent))
| parent | Parent entity to attach through ChildOf. |
|
inline |
Commits all gathered changes and performs an archetype movement.
|
inline |
Removes the registered component or pair type from the pending entity state.
| T | Component or pair type to remove. |
|
inline |
Prepares an archetype movement by following the "del" edge of the current archetype.
| entity | Removed entity |
|
inline |
Prepares an archetype movement by following the "del" edge of the current archetype.
| pair | Relationship pair |
|
inline |
Assigns a name to entity. Ignored if used with pair. The string is copied and kept internally.
| name | A null-terminated string. |
| len | String length. If zero, the length is calculated. |
|
inline |
Assigns a name to entity. Ignored if used with pair. The string is NOT copied. Your are responsible for its lifetime.
| name | Pointer to a stable null-terminated string. |
| len | String length. If zero, the length is calculated. |
|
inline |
Marks the entity as a prefab.
|
inline |
Takes care of registering the component type used by T.
| T | Component or pair type to register. |