implement load config on game restart

This commit is contained in:
2026-04-22 22:53:56 +02:00
parent 1b218941bd
commit 78f746d352
6 changed files with 71 additions and 27 deletions

View File

@@ -26,12 +26,17 @@ class WaveSystem;
class Simulation
{
public:
explicit Simulation(const GameConfig& config, unsigned int seed = 0);
explicit Simulation(GameConfig config, unsigned int seed = 0);
~Simulation();
const GameConfig& config() const;
// Reinitializes all simulation state as if constructed fresh.
void reset(unsigned int seed = 0);
// Reloads config then reinitializes all simulation state.
void reset(GameConfig newConfig, unsigned int seed = 0);
// Advances the simulation by one tick. Tick order per architecture.md §Tick Order.
void tick();
@@ -83,7 +88,7 @@ private:
// Award a random blueprint drop (REQ-DEF-BLUEPRINT-DROP) and emit the event.
void awardBlueprintDrop();
const GameConfig& m_config;
GameConfig m_config;
std::mt19937 m_rng;
Tick m_currentTick;