Centralized entity lifecycle management system for R-Type server.
This file contains the Registry class declaration.
Class for managing entities and their components.
Central entity lifecycle manager for the R-Type game server.
Manages wave-based enemy spawning with configurable patterns and timing.
~WaveManager()=default
Destructor.
bool m_waveInProgress
Whether a wave is currently spawning.
bool isActive() const
Check if wave system is currently active.
bool m_completed
Whether all waves are completed.
void startNextWave()
Start the next wave in sequence.
std::vector< Wave > m_waves
List of all configured waves.
void clearWaves()
Clear all configured waves.
float m_spawnTimer
Timer for processing enemy spawns.
void createWave3()
Create wave 3 configuration (increased difficulty)
bool isReady() const
Check if initial delay has passed and waves can start.
void update(ecs::Registry ®istry, float dt, int screenWidth)
Update wave manager logic (called each frame)
WaveManager(const WaveManager &)=delete
Deleted copy constructor (non-copyable)
void start()
Start the wave system.
static constexpr float INITIAL_DELAY
Initial delay in seconds (synced with client)
bool m_initialDelayPassed
Whether initial delay has elapsed.
float m_initialDelayTimer
Timer for initial delay countdown.
size_t getTotalWaves() const
Get total number of configured waves.
WaveManager(EntityManager &entityManager)
Constructor.
void reset()
Stop and reset the wave system to initial state.
void createWave1()
Create wave 1 configuration (basic introduction wave)
bool isCompleted() const
Check if all waves have been completed.
bool isWaveCleared() const
Check if current wave is cleared of all enemies.
int m_currentWaveIndex
Index of current/next wave (0-based)
std::vector< bool > m_enemiesSpawned
Track which enemies in current wave have spawned.
int getCurrentWave() const
Get current wave index.
void processSpawns(float dt, int screenWidth)
Process enemy spawns for current wave.
EntityManager & m_entityManager
Reference to entity manager for spawning.
void createBossWave()
Create boss wave configuration (final challenge)
void setupDefaultWaves()
Initialize with default wave patterns.
void createWave4()
Create wave 4 configuration (final standard wave)
WaveManager(WaveManager &&)=delete
Deleted move constructor (non-movable)
float m_waveTimer
Timer for current wave duration.
void addWave(const Wave &wave)
Add a custom wave to the wave list.
WaveManager & operator=(WaveManager &&)=delete
Deleted move assignment operator (non-movable)
void createWave2()
Create wave 2 configuration (mixed enemies)
bool m_active
Whether wave system is active.
WaveManager & operator=(const WaveManager &)=delete
Deleted copy assignment operator (non-copyable)
ServerEntityType
Enumeration of entity types managed by the server.
Definition of a single enemy spawn within a wave.
float spawnDelay
Delay in seconds from wave start before spawning this enemy.
float health
Initial health points for this enemy.
float y
Spawn Y position (vertical placement on screen)
float x
Spawn X position (typically off-screen right)
ServerEntityType type
Type of enemy to spawn (ENEMY_BASIC, ENEMY_ADVANCED, or BOSS)
Complete wave configuration containing multiple enemy spawns.
std::vector< EnemySpawn > enemies
List of all enemies to spawn in this wave.
int waveNumber
Wave sequence number (1-based)
std::function< void()> onComplete
Optional callback function invoked when wave completes.
bool waitForClear
If true, next wave starts only when all enemies are destroyed.
float duration
Maximum duration in seconds before next wave (if not waitForClear)