Commit Graph

14 Commits

Author SHA1 Message Date
df7f60c898 migrate every factory query off BuildingSystem onto the free functions
The eleven forwarding members added last commit are gone; callers now read the
data directly through FactoryQueries.h. Simulation and ArenaSimulation expose
getFactoryState() so the UI, the balancing view and the tests can reach it.

isQueuedForDeconstruction joined the free functions along the way — it only
reaches findBuilding, so it was state-pure too.

No facade was introduced. The chained form was the reason one looked attractive,
but rewriting sim.getBuildings().findBuilding(id) to findBuilding(sim.getFactoryState(), id)
turned out to be mechanical, and the result says which data is read rather than
which system happens to own it.

BuildingSystem.cpp is down to 1735 lines and no longer answers questions about
the factory — it only changes it. What remains on it are the mutators, the tick
phases, and the queries that also need GameConfig.

Verified with a golden-checksum capture before and after — all four sample ticks
identical.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YHcUerKAZKWNvSKJxYKbnG
2026-08-04 21:52:49 +02:00
3c549a160c share one loadTestConfig() helper across the tests
19 test translation units each defined an identical local loadConfig().
They now include src/test/TestConfig.h, which lives off the lib/ui/app
include path like SimulationTestAccess.h.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GH8ZMRY3vhxxXcaUxBqxkk
2026-08-02 20:53:21 +02:00
a9082c57f3 Implement config-driven unlock groups so that multiple things can be unlocked at once (including buildings) 2026-07-22 21:34:59 +02:00
d412c69f82 Prefix all getters with "get" 2026-07-19 21:17:38 +02:00
d74ba5bfad Replay: deterministic record & playback (#4)
Add deterministic record/playback for a run.

Recording captures `(seed, config hash, ordered tick-tagged commands)` and re-simulates on playback — no state snapshots. `DotaFactory.exe --replay <file>` re-plays a recorded run view-only with manual speed/pause.

Reviewed-on: #4
Co-authored-by: Malte Langkabel <malte.langkabel@gmail.com>
Co-committed-by: Malte Langkabel <malte.langkabel@gmail.com>
2026-07-01 19:20:08 +00:00
aad094f842 allow to configure when which schematic gets unlockable 2026-06-10 21:09:03 +02:00
25ff3c56c5 move ecs related code to own folder 2026-05-25 09:10:54 +02:00
b57299fd2a rename EntityId to BuildingId 2026-05-23 07:53:56 +02:00
bd488db8ef remove unused building HP 2026-05-22 21:34:21 +02:00
ca07cbaf0e switch to ECS architecture 2026-05-22 20:31:39 +02:00
7e0104e9b8 fix config data paths 2026-04-29 21:32:32 +02:00
fb83db98ab rename blueprint to schematic 2026-04-26 21:00:55 +02:00
fff5d43352 make tests run again 2026-04-24 20:30:20 +02:00
393c49e1bb fix issue where shipyard did not produce anything 2026-04-21 22:17:48 +02:00