move the two item visitors to the queries they always were
forEachEmergingItem and forEachIncomingItem took a const FactoryState& and touched no member of BuildingSystem: they read the state and the free geometry helpers and nothing else. They are queries wearing a system's uniform, and their one caller -- the renderer -- reached through getBuildings() to call them, passing the state back in as an argument. They move to FactoryQueries beside the rest of the read surface, and the renderer calls them directly. With that, BuildingSystem answers no queries at all: its const accessor on Simulation and on ArenaSimulation had no other user, so both are gone. Nothing outside the command path can now reach the system. No behaviour changes; the bodies move verbatim apart from two arrows in comments that were non-ASCII. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
This commit is contained in:
@@ -494,11 +494,6 @@ const FactoryState& ArenaSimulation::getFactoryState() const
|
||||
return m_factoryState;
|
||||
}
|
||||
|
||||
const BuildingSystem& ArenaSimulation::getBuildings() const
|
||||
{
|
||||
return *m_buildingSystem;
|
||||
}
|
||||
|
||||
const ShipSystem& ArenaSimulation::getShips() const
|
||||
{
|
||||
return *m_shipSystem;
|
||||
|
||||
@@ -85,7 +85,6 @@ public:
|
||||
Tick getCurrentTick() const;
|
||||
|
||||
const ArenaConfig& getArenaConfig() const;
|
||||
const BuildingSystem& getBuildings() const;
|
||||
const FactoryState& getFactoryState() const;
|
||||
const ShipSystem& getShips() const;
|
||||
const DebrisSystem& getDebrisSystem() const;
|
||||
|
||||
Reference in New Issue
Block a user