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
+4 -3
View File
@@ -16,7 +16,7 @@ func _run() -> void:
var pantry: StorageStateRecord = manager.get_pantry()
pantry.withdraw(SimulationIds.RESOURCE_FOOD, 1000.0)
manager._sync_village_food()
manager.economy.sync_resource(SimulationIds.RESOURCE_FOOD)
var resource := ResourceStateRecord.from_dictionary(
{
"schema_version": ResourceStateRecord.SCHEMA_VERSION,
@@ -190,7 +190,7 @@ func _test_wood_work_requires_material() -> void:
var woodpile: StorageStateRecord = manager.get_woodpile()
woodpile.withdraw(SimulationIds.RESOURCE_WOOD, 1000.0)
woodpile.deposit(SimulationIds.RESOURCE_WOOD, 0.5)
manager._sync_village_wood()
manager.economy.sync_resource(SimulationIds.RESOURCE_WOOD)
var npc: SimNPC = manager.npcs[0]
var safety_before: float = manager.village.safety
@@ -215,7 +215,8 @@ func _test_wood_work_requires_material() -> void:
"An unpaid completion cost should create a readable blocked-task fact"
)
manager.add_wood(1.5)
woodpile.deposit(SimulationIds.RESOURCE_WOOD, 1.5)
manager.economy.sync_resource(SimulationIds.RESOURCE_WOOD)
_check(
(
is_equal_approx(woodpile.get_amount(SimulationIds.RESOURCE_WOOD), 2.0)