fix: enforce village resource invariants

This commit is contained in:
Rijad Zuzo
2026-07-09 23:10:18 +02:00
parent d6520c426a
commit 5cbab527bf
9 changed files with 136 additions and 42 deletions
+14
View File
@@ -68,6 +68,20 @@ func _test_selection_and_execution_are_separate() -> void:
work_selection.scores.size() == 4,
"Ordinary work selection should expose all compared utility scores"
)
var guard := SimNPC.new(701, "BoundaryGuard", SimulationIds.PROFESSION_GUARD, 5.0, 5.0)
guard.hunger = 20.0
guard.energy = 80.0
village.food = 100.0
village.wood = 0.0
village.safety = 0.0
village.knowledge = 100.0
village.update_modifiers()
village.update_priorities()
var unfunded_selection := selector.select_action(guard, village, 0.5)
_check(
unfunded_selection.action_id == SimulationIds.ACTION_GATHER_WOOD,
"A guard should gather wood instead of selecting patrol when its material cost is unavailable"
)
func _test_target_resolution_and_travel_are_separate() -> void: