InitializerList Class Template
Composite initializer that executes multiple SpawnInitializers in sequence. More...
Declaration
Base class
| class | SpawnInitializer |
|
Abstract interface for initializing spawned entity state. More... | |
Public Constructors Index
template <typename... Args> | |
| InitializerList (std::unique_ptr< Args > &&...args) | |
|
Constructs an InitializerList from variadic initializer arguments. More... | |
Public Member Functions Index
template <std::size_t N> | |
| void | initialize (helios::engine::ecs::GameObject gameObject, const SpawnPlanCursor &cursor, const SpawnContext &spawnContext) override |
|
Executes all initializers in sequence on the spawned GameObject. More... | |
Private Member Attributes Index
template <std::size_t N> | |
| const std::array< std::unique_ptr< SpawnInitializer >, N > | initializers_ |
|
Fixed-size array of initializers to execute. More... | |
Description
Composite initializer that executes multiple SpawnInitializers in sequence.
InitializerList allows combining multiple initialization behaviors into a single initializer. Each initializer in the list is executed in order during the spawn process.
**Usage:** ```cpp auto initializer = std::make_unique<InitializerList<2>>( std::make_unique<DirectionInitializer>(vec3f{1, 0, 0}), std::make_unique<VelocityInitializer>(100.0f) ); ```
- Template Parameters
-
N The number of initializers in the list. Must match the number of arguments passed to the constructor.
- See Also
- See Also
Definition at line 42 of file InitializerList.ixx.
Public Constructors
InitializerList()
| inline explicit |
Constructs an InitializerList from variadic initializer arguments.
- Template Parameters
-
Args Types of the initializer unique_ptrs.
- Parameters
-
args Unique pointers to SpawnInitializer instances. The number of arguments must match the template parameter N.
Definition at line 61 of file InitializerList.ixx.
Public Member Functions
initialize()
| inline virtual |
Executes all initializers in sequence on the spawned GameObject.
- Parameters
-
gameObject The GameObject being initialized.
cursor The current spawn plan cursor with batch and index information.
spawnContext Context providing access to spawn-related data.
Definition at line 70 of file InitializerList.ixx.
Private Member Attributes
initializers_
|
Fixed-size array of initializers to execute.
Definition at line 47 of file InitializerList.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.