move FactoryState ownership out of BuildingSystem to Simulation

This commit is contained in:
2026-08-05 06:43:52 +02:00
parent 0edea5d961
commit 46932e4abf
10 changed files with 97 additions and 43 deletions

View File

@@ -94,6 +94,7 @@ void Simulation::reset(unsigned int seed)
m_pendingSchematicChoices.clear();
m_admin.clear();
m_factoryState = FactoryState{};
m_beltSystem = BeltSystem(m_config.world.beltSpeed_tps);
initializeSubsystems();
@@ -105,6 +106,7 @@ void Simulation::initializeSubsystems()
{
m_buildingSystem = std::make_unique<BuildingSystem>(
m_config,
m_factoryState,
m_beltSystem,
[this]() { return allocateBuildingId(); },
[this](int amount) { m_buildingBlocksStock += amount; },