refactor: clarify simulation ownership

This commit is contained in:
Rijad Zuzo
2026-07-10 11:02:11 +02:00
parent 0f7b12080e
commit ce8f71082b
29 changed files with 793 additions and 587 deletions
+6 -2
View File
@@ -20,8 +20,10 @@ world only when consumed.
- `StorageStateRecord` owns pantry and woodpile contents and capacity.
- `SimNPC.inventory` owns carried item amounts.
- `SimulationManager` performs deposit, withdrawal, and consumption
transactions.
- `VillageEconomy` performs deposit, withdrawal, consumption, and
definition-backed completion-cost transactions.
- `SimulationManager` coordinates action lifecycle and exposes the transaction
results to presentation.
- `village.food` and `village.wood` are synchronized aggregate views used by
the existing UI, priorities, and utility scoring. They are not second
mutation paths.
@@ -45,6 +47,8 @@ Transactions apply the amount actually available:
- extraction cannot exceed the source;
- deposit cannot exceed storage capacity;
- player extraction is limited to storage capacity until player inventory
exists, so overflow remains at the source;
- withdrawal cannot exceed pantry contents;
- eating succeeds only when the NPC carries one food.