AddComponentCommand Struct Template
Deferred command that adds a component of type TComponent to an entity. More...
Declaration
Public Member Typedefs Index
template <typename TComponent> | |
| using | Handle_type = TComponent::Handle_type |
|
Handle type derived from the component. More... | |
template <typename TComponent> | |
| using | Component_type = TComponent |
|
The component type being added. More... | |
Public Constructors Index
template <typename TComponent> | |
| AddComponentCommand (Handle_type handle) | |
|
Constructs the command with a default-initialised component. More... | |
template <typename ... TArgs> | |
| AddComponentCommand (Handle_type handle, TArgs &&...args) | |
|
Constructs the command and forwards arguments to the component constructor. More... | |
Public Member Attributes Index
template <typename TComponent> | |
| Handle_type | handle |
|
Handle of the target entity. More... | |
template <typename TComponent> | |
| TComponent | component |
|
Component instance that will be attached. More... | |
Description
Deferred command that adds a component of type TComponent to an entity.
Intended to be queued and processed by a command consumer (e.g. a system or entity manager) rather than applied immediately, keeping structural ECS mutations out of hot iteration loops.
- Template Parameters
-
TComponent Component type to attach. Must expose Handle_type.
Definition at line 24 of file AddComponentCommand.ixx.
Public Member Typedefs
Component_type
|
The component type being added.
Definition at line 30 of file AddComponentCommand.ixx.
Handle_type
|
Handle type derived from the component.
Definition at line 27 of file AddComponentCommand.ixx.
Public Constructors
AddComponentCommand()
| inline explicit |
Constructs the command with a default-initialised component.
- Parameters
-
handle Target entity handle.
Definition at line 43 of file AddComponentCommand.ixx.
AddComponentCommand()
| inline explicit |
Constructs the command and forwards arguments to the component constructor.
- Template Parameters
-
TArgs Component constructor argument types.
- Parameters
-
handle Target entity handle.
args Arguments forwarded to TComponent.
Definition at line 56 of file AddComponentCommand.ixx.
Public Member Attributes
component
|
Component instance that will be attached.
Definition at line 36 of file AddComponentCommand.ixx.
handle
|
Handle of the target entity.
Definition at line 33 of file AddComponentCommand.ixx.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.