|
EnTT
3.5.0
|
Dedicated to those who aren't confident with the entity-component-system architecture. More...
#include <actor.hpp>
Public Types | |
| using | registry_type = basic_registry< Entity > |
| Type of registry used internally. | |
| using | entity_type = Entity |
| Underlying entity identifier. | |
Public Member Functions | |
| basic_actor (basic_actor &&other) noexcept | |
| Move constructor. More... | |
| basic_actor (registry_type &ref) | |
| Constructs an actor from a given registry. More... | |
| basic_actor (entity_type entity, registry_type &ref) noexcept | |
| Constructs an actor from a given entity. More... | |
| virtual | ~basic_actor () |
| Default destructor. | |
| basic_actor & | operator= (basic_actor &&other) noexcept |
| Move assignment operator. More... | |
| template<typename Component , typename... Args> | |
| decltype(auto) | assign (Args &&... args) |
| Assigns the given component to an actor. More... | |
| template<typename Component > | |
| void | remove () |
| Removes the given component from an actor. More... | |
| template<typename... Component> | |
| bool | has () const |
| Checks if an actor has the given components. More... | |
| template<typename... Component> | |
| decltype(auto) | get () const |
| Returns references to the given components for an actor. More... | |
| template<typename... Component> | |
| decltype(auto) | get () |
| Returns references to the given components for an actor. More... | |
| template<typename... Component> | |
| auto | try_get () const |
| Returns pointers to the given components for an actor. More... | |
| template<typename... Component> | |
| auto | try_get () |
| Returns pointers to the given components for an actor. More... | |
| const registry_type & | backend () const noexcept |
| Returns a reference to the underlying registry. More... | |
| registry_type & | backend () noexcept |
| Returns a reference to the underlying registry. More... | |
| entity_type | entity () const noexcept |
| Returns the entity associated with an actor. More... | |
| operator bool () const | |
| Checks if an actor refers to a valid entity or not. More... | |
Dedicated to those who aren't confident with the entity-component-system architecture.
Tiny wrapper around a registry, for all those users that aren't confident with entity-component-system architecture and prefer to iterate objects directly.
| Entity | A valid entity type (see entt_traits for more details). |
|
inlinenoexcept |
|
inlineexplicit |
|
inlineexplicitnoexcept |
|
inline |
Assigns the given component to an actor.
A new instance of the given component is created and initialized with the arguments provided (the component must have a proper constructor or be of aggregate type). Then the component is assigned to the actor.
In case the actor already has a component of the given type, it's replaced with the new one.
| Component | Type of the component to create. |
| Args | Types of arguments to use to construct the component. |
| args | Parameters to use to initialize the component. |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inlineexplicit |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
1.8.18