migrate every factory query off BuildingSystem onto the free functions

This commit is contained in:
2026-08-05 06:45:49 +02:00
parent 1fb63cce4e
commit 58b94223f7
20 changed files with 212 additions and 244 deletions

View File

@@ -1,4 +1,5 @@
#include "catch.hpp"
#include "FactoryQueries.h"
#include <random>
@@ -100,7 +101,7 @@ TEST_CASE("WaveSystem: Simulation pre-places HQ + 2 player + 2 enemy stations",
// HQ is still a Building (for belt integration).
int hqCount = 0;
for (const Building& b : sim.getBuildings().getAllBuildings())
for (const Building& b : getAllBuildings(sim.getFactoryState()))
{
if (b.type == BuildingType::Hq) { ++hqCount; }
}
@@ -143,7 +144,7 @@ TEST_CASE("WaveSystem: HQ anchor is at asteroid right edge", "[wave]")
{
const Simulation sim(loadTestConfig(), 42);
for (const Building& b : sim.getBuildings().getAllBuildings())
for (const Building& b : getAllBuildings(sim.getFactoryState()))
{
if (b.type != BuildingType::Hq) { continue; }
// Rightmost body cell must be at x = -1 (asteroid right edge).