|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Temporary reference to an incomplete entity that is currently being built inside of an EntityRegistry and will be automatically destroyed and cleaned up if EntityBuilder::build() is not successfully called by the end of the scope. More...
#include <GREM/execution/EntityRegistry.hpp>
Public Member Functions | |
| GREM_ALWAYS_INLINE constexpr | EntityBuilder (EntReg ®istry, EntityID entityID) noexcept |
| Construct an entity builder. | |
| ~EntityBuilder () | |
| Destructor. | |
| EntityBuilder (const EntityBuilder &)=delete | |
| Copying an entity builder is not allowed. | |
| EntityBuilder (EntityBuilder &&other) noexcept | |
| Move constructor. | |
| EntityBuilder & | operator= (const EntityBuilder &)=delete |
| Copying an entity builder is not allowed. | |
| EntityBuilder & | operator= (EntityBuilder &&)=delete |
| Relocating an entity builder is not allowed. | |
| EntityID | setEntityFlags (EntityID::Flags newFlags) |
| Update the flags embedded in the entity's handle. | |
| GREM_ALWAYS_INLINE EntReg & | getRegistry () noexcept |
| Get the underlying entity registry containing the entity being built. | |
| GREM_ALWAYS_INLINE const EntReg & | getRegistry () const noexcept |
| Get the underlying entity registry containing the entity being built. | |
| GREM_ALWAYS_INLINE EntityID | getEntityID () const noexcept |
| Get the entity handle of the entity being built. | |
| template<component T, typename... Args> | |
| T & | addComponent (Args &&... args) |
| Add a component to the entity being built. | |
| template<component T, typename... Args> | |
| T * | addComponentIfMissing (Args &&... args) |
| Add a component to the entity being built if it doesn't already have it. | |
| template<component T> | |
| T & | addOrAssignComponent (T &&value) |
| Add a component to the entity being built, or assign to it if it already has one. | |
| template<component T> | |
| T & | addOrAssignComponent (const T &value) |
| Add a component to the entity being built, or assign to it if it already has one. | |
| template<component T> | |
| bool | removeComponent () noexcept |
| Erase a component from the entity being built. | |
| bool | removeAllComponents () noexcept |
| Erase all components from the entity being built. | |
| template<component T> | |
| bool | hasComponent () const noexcept |
| Check if the entity being built has a specific component. | |
| template<component T> | |
| T & | getComponent () |
| Get a specific component of the entity being built. | |
| template<component T> | |
| const T & | getComponent () const |
| Get a specific component of the entity being built. | |
| template<component T, typename U> | |
| T | getComponentOr (U &&defaultValue) const |
| Get a specific component of the entity being built, or a default value in case the entity doesn't exist or doesn't have the specified component. | |
| template<component T> | |
| T * | findComponent () noexcept |
| Try to get a specific component of the entity being built. | |
| template<component T> | |
| const T * | findComponent () const noexcept |
| Try to get a specific component of the entity being built. | |
| GREM_ALWAYS_INLINE EntityID | build () |
| Finish building the entity, allowing it to persist. | |
Temporary reference to an incomplete entity that is currently being built inside of an EntityRegistry and will be automatically destroyed and cleaned up if EntityBuilder::build() is not successfully called by the end of the scope.
| EntReg | concrete specialization of EntityRegistry being referenced. |
|
inlinenodiscardconstexprnoexcept |
Construct an entity builder.
| registry | entity registry containing the entity being built. |
| entityID | entity handle of the entity being built. |
|
inline |
Destructor.
|
delete |
Copying an entity builder is not allowed.
|
inlinenoexcept |
Move constructor.
|
delete |
Copying an entity builder is not allowed.
|
delete |
Relocating an entity builder is not allowed.
|
inline |
Update the flags embedded in the entity's handle.
| newFlags | new flags to set. |
|
inlinenodiscardnoexcept |
Get the underlying entity registry containing the entity being built.
|
inlinenodiscardnoexcept |
Get the underlying entity registry containing the entity being built.
|
inlinenodiscardnoexcept |
Get the entity handle of the entity being built.
|
inline |
Add a component to the entity being built.
| T | component type to add. |
| args | arguments to forward to the component constructor. |
| std::logic_error | if the entity already has the specified component. |
| std::out_of_range | if the underlying handle does not correspond to a valid entity. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the component constructor. |
|
inline |
Add a component to the entity being built if it doesn't already have it.
| T | component type to add. |
| args | arguments to forward to the component constructor. |
| std::out_of_range | if the underlying handle does not correspond to a valid entity. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the component constructor. |
|
inline |
Add a component to the entity being built, or assign to it if it already has one.
| T | component type to add or assign. |
| value | component value to add or assign. |
| std::out_of_range | if the underlying handle does not correspond to a valid entity. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the move constructor or move assignment operator of the component type. |
|
inline |
Add a component to the entity being built, or assign to it if it already has one.
| T | component type to add or assign. |
| value | component value to add or assign. |
| std::out_of_range | if the underlying handle does not correspond to a valid entity. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| any | exception thrown by the copy constructor or copy assignment operator of the component type. |
|
inlinenoexcept |
Erase a component from the entity being built.
| T | component type to remove. |
|
inlinenoexcept |
Erase all components from the entity being built.
|
inlinenodiscardnoexcept |
Check if the entity being built has a specific component.
| T | component type to check for. |
|
inlinenodiscard |
Get a specific component of the entity being built.
| T | component type to get. |
| std::out_of_range | if the underlying entity handle does not correspond to a valid entity with the specified component. |
|
inlinenodiscard |
Get a specific component of the entity being built.
| T | component type to get. |
| std::out_of_range | if the underlying entity handle does not correspond to a valid entity with the specified component. |
|
inlinenodiscard |
Get a specific component of the entity being built, or a default value in case the entity doesn't exist or doesn't have the specified component.
| T | component type to get. |
| defaultValue | default value to return in case the underlying entity handle does not correspond to a valid entity with the specified component. |
|
inlinenodiscardnoexcept |
Try to get a specific component of the entity being built.
| T | component type to get. |
|
inlinenodiscardnoexcept |
Try to get a specific component of the entity being built.
| T | component type to get. |
|
inline |
Finish building the entity, allowing it to persist.
This will set the entity builder's underlying entity handle to an invalid default-constructed handle, meaning the entity builder can no longer be used, and the entity will no longer get destroyed and cleaned up when the entity builder goes out of scope.