|
R-Type
Distributed multiplayer game engine in C++
|
System managing entity spawning and wave generation. More...
#include <SpawnSystem.hpp>


Public Member Functions | |
| SpawnSystem () | |
| Constructs a SpawnSystem with default wave configuration. | |
| ~SpawnSystem () override=default | |
| Default destructor. | |
| void | update (Registry ®istry, float deltaTime) override |
| Manages entity spawning based on wave progression. | |
| ComponentMask | getComponentMask () const override |
| Gets the component mask for this system. | |
Public Member Functions inherited from ecs::ISystem | |
| virtual | ~ISystem ()=default |
| Virtual destructor. | |
Private Member Functions | |
| void | _spawnEnemy (Registry ®istry, const SpawnRequest &request) |
| Internal method to spawn an enemy from a request. | |
System managing entity spawning and wave generation.
Handles enemy waves, power-ups spawning, and entity creation based on game progression and patterns.
Processes SpawnRequest queues from Spawner components—the clean ECS way to handle dynamic spawning without tight coupling.
Definition at line 25 of file SpawnSystem.hpp.
| ecs::SpawnSystem::SpawnSystem | ( | ) |
Constructs a SpawnSystem with default wave configuration.
Initializes with wave 1, 5 enemies per wave, and 2-second spawn interval.
Definition at line 21 of file SpawnSystem.cpp.
|
overridedefault |
Default destructor.
|
private |
Internal method to spawn an enemy from a request.
| registry | Reference to the ECS registry |
| request | The spawn request with all parameters |
Definition at line 95 of file SpawnSystem.cpp.
References ecs::SpawnRequest::enemyType, ecs::SpawnRequest::health, LOG_ERROR, ecs::Registry::newEntity(), ecs::SpawnRequest::scoreValue, ecs::SpawnRequest::scriptPath, ecs::Registry::setComponent(), ecs::SpawnRequest::x, and ecs::SpawnRequest::y.
Referenced by update().

|
overridevirtual |
Gets the component mask for this system.
Implements ecs::ISystem.
Definition at line 146 of file SpawnSystem.cpp.
|
overridevirtual |
Manages entity spawning based on wave progression.
Processes spawn requests from Spawner components. Handles the actual entity creation with all components.
| registry | Reference to the ECS registry |
| deltaTime | Time elapsed since last frame (in seconds) |
Implements ecs::ISystem.
Definition at line 23 of file SpawnSystem.cpp.
References _spawnEnemy(), ecs::Spawner::currentWaveIndex, ecs::WaveConfig::enemies, ecs::Registry::getComponent(), ecs::Spawner::getConfig(), ecs::Spawner::getConfigMutable(), ecs::Spawner::isActive, LOG_INFO, LOG_WARNING, ecs::Registry::view(), ecs::Spawner::waveElapsedTime, ecs::SpawnerConfig::waves, and ecs::SpawnerConfig::wavesIntervals.
