|
R-Type
Distributed multiplayer game engine in C++
|
Component that holds spawn requests to be processed by SpawnSystem. More...
#include <Spawner.hpp>


Public Member Functions | |
| Spawner ()=default | |
| ~Spawner () override=default | |
| void | queueSpawn (const SpawnRequest &request) |
| Queue a spawn request. | |
| const std::vector< SpawnRequest > & | getSpawnRequests () const |
| Get all pending spawn requests. | |
| void | clearSpawnRequests () |
| Clear all pending spawn requests (called after processing) | |
| bool | hasPendingSpawns () const |
| Check if there are pending spawns. | |
| ComponentType | getType () const override |
| Get component type ID. | |
| void | setConfig (const SpawnerConfig &config) |
| const SpawnerConfig & | getConfig () const |
| SpawnerConfig & | getConfigMutable () |
Public Member Functions inherited from ecs::IComponent | |
| virtual | ~IComponent ()=default |
| Virtual destructor. | |
Public Attributes | |
| float | waveElapsedTime = 0.0f |
| int | currentWaveIndex = 0 |
| bool | isActive = true |
Private Attributes | |
| std::vector< SpawnRequest > | _spawnRequests |
| SpawnerConfig | _config = {} |
Component that holds spawn requests to be processed by SpawnSystem.
Entities with this component act as spawners. They queue up spawn requests that the SpawnSystem will process each frame. This is the clean ECS way to handle dynamic spawning without direct entity creation in Lua.
Definition at line 48 of file Spawner.hpp.
|
default |
|
overridedefault |
|
inline |
Clear all pending spawn requests (called after processing)
Definition at line 68 of file Spawner.hpp.
References _spawnRequests.
|
inline |
Definition at line 95 of file Spawner.hpp.
References _config.
Referenced by ecs::SpawnSystem::update().
|
inline |
Definition at line 96 of file Spawner.hpp.
References _config.
Referenced by ecs::SpawnSystem::update().
|
inline |
Get all pending spawn requests.
Definition at line 63 of file Spawner.hpp.
References _spawnRequests.
|
inlineoverridevirtual |
Get component type ID.
Implements ecs::IComponent.
Definition at line 80 of file Spawner.hpp.
|
inline |
Check if there are pending spawns.
Definition at line 74 of file Spawner.hpp.
References _spawnRequests.
|
inline |
Queue a spawn request.
| request | The spawn request to queue |
Definition at line 57 of file Spawner.hpp.
References _spawnRequests.
Referenced by scripting::bindings::bindServerGame().
|
inline |
Definition at line 82 of file Spawner.hpp.
References _config, currentWaveIndex, isActive, waveElapsedTime, and ecs::SpawnerConfig::waves.
Referenced by scripting::bindings::bindServerGame().
|
private |
Definition at line 105 of file Spawner.hpp.
Referenced by getConfig(), getConfigMutable(), and setConfig().
|
private |
Definition at line 104 of file Spawner.hpp.
Referenced by clearSpawnRequests(), getSpawnRequests(), hasPendingSpawns(), and queueSpawn().
| int ecs::Spawner::currentWaveIndex = 0 |
Definition at line 99 of file Spawner.hpp.
Referenced by setConfig(), and ecs::SpawnSystem::update().
| bool ecs::Spawner::isActive = true |
Definition at line 101 of file Spawner.hpp.
Referenced by server::GameLogic::_checkGameOverCondition(), setConfig(), and ecs::SpawnSystem::update().
| float ecs::Spawner::waveElapsedTime = 0.0f |
Definition at line 98 of file Spawner.hpp.
Referenced by setConfig(), and ecs::SpawnSystem::update().