number the buildings from the factory that holds them
The building-id counter was the last piece of factory data living on Simulation behind a callback: every construction site, every building, and every tile a station entity claims took its id from a std::function BuildingSystem held, which the arena and three test fixtures each had to supply. It moves into FactoryState as nextBuildingId, handed out by allocateBuildingId(state) in FactoryQueries beside the other operations over the state. BuildingSystem's callback is gone; so are Simulation::allocateBuildingId and ArenaSimulation::allocateBuildingId, whose remaining callers now allocate from the state directly. Checksum order is untouched: Simulation folds the counter where it always did. What is left on BuildingSystem is the config, the belts, the RNG, and two callbacks that reach genuinely outside the factory -- spawning a finished ship into the entity model, and testing an output group against the unlock state. Neither is factory data, so this is where the migration stops. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
This commit is contained in:
@@ -99,7 +99,6 @@ struct PlacementFixture
|
||||
FactoryState state = makeFactoryState(cfg);
|
||||
BeltSystem belts;
|
||||
std::mt19937 rng{0};
|
||||
BuildingId nextBuildingId = 1;
|
||||
BuildingSystem bs;
|
||||
|
||||
// Blocks credited back since the run began. The state is seeded with the configured
|
||||
@@ -118,7 +117,6 @@ struct PlacementFixture
|
||||
std::function<bool(const std::string&)> isItemUnlocked = nullptr)
|
||||
: belts(beltSpeed_tps.value_or(cfg.world.beltSpeed_tps))
|
||||
, bs(cfg, belts,
|
||||
[this]() { return nextBuildingId++; },
|
||||
[](const std::string&, QVector2D, const std::optional<ShipLayoutConfig>&) {},
|
||||
isItemUnlocked ? std::move(isItemUnlocked)
|
||||
: std::function<bool(const std::string&)>(
|
||||
|
||||
Reference in New Issue
Block a user