make construction its own system (extracted from BuildingSystem)

This commit is contained in:
2026-08-05 06:57:12 +02:00
parent fd85e8e10a
commit 1f4503176b
9 changed files with 196 additions and 148 deletions

View File

@@ -1,6 +1,7 @@
#include "Simulation.h"
#include "FactoryQueries.h"
#include "ConstructionSystem.h"
#include "PlacementRules.h"
#include <algorithm>
@@ -123,6 +124,7 @@ void Simulation::initializeSubsystems()
},
[this](const std::string& itemId) -> bool { return isItemUnlocked(itemId); },
m_rng);
m_constructionSystem = std::make_unique<ConstructionSystem>(m_config);
m_shipSystem = std::make_unique<ShipSystem>(m_config, m_admin);
m_aiSystem = std::make_unique<AiSystem>(m_config);
m_movementIntentSystem = std::make_unique<MovementIntentSystem>();
@@ -243,7 +245,7 @@ void Simulation::tick()
m_waveSystem->tickThreatAccumulation();
// Construction + production pipeline
m_buildingSystem->tickConstruction(m_factoryState, m_currentTick);
m_constructionSystem->tick(m_factoryState, m_beltSystem, m_currentTick);
m_buildingSystem->tickDeconstruction(m_factoryState, m_currentTick); // parallel to construction
m_buildingSystem->tickBeltPull(m_factoryState); // step 3
m_buildingSystem->tickProduction(m_factoryState, m_currentTick); // step 4