RandomDirectionInitializer Class
Initializer that configures spawned entities with random direction. More...
Declaration
Base class
| class | SpawnInitializer |
|
Abstract interface for initializing spawned entity state. More... | |
Public Member Functions Index
| void | initialize (helios::engine::ecs::GameObject gameObject, const SpawnPlanCursor &cursor, const SpawnContext &spawnContext) override |
|
Initializes entity with a random direction. More... | |
Description
Initializer that configures spawned entities with random direction.
RandomDirectionInitializer generates a random 2D direction and applies it to the entity's DirectionComponent and Move2DComponent. This is useful for spawning enemies that should move in unpredictable directions.
Components affected:
- **DirectionComponent:** Sets random normalized direction
- **Move2DComponent:** Sets move intent in the random direction
Uses a static Random generator with a fixed seed for reproducibility.
- See Also
Definition at line 35 of file RandomDirectionInitializer.ixx.
Public Member Functions
initialize()
| inline virtual |
Initializes entity with a random direction.
- Parameters
-
gameObject The entity to initialize.
cursor The current position within the spawn batch (unused).
spawnContext Context data (unused).
Definition at line 46 of file RandomDirectionInitializer.ixx.
References helios::engine::modules::physics::motion::components::Move2DComponent::direction, helios::engine::ecs::GameObject::get and helios::engine::modules::physics::motion::components::Move2DComponent::move.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.