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
+3 -9
View File
@@ -5,7 +5,7 @@ var food := 20.0
var wood := 10.0
var safety := 50.0
var knowledge := 0.0
var debug_logs := true
var debug_logs := false
var food_modifier := 1.0
var wood_modifier := 1.0
@@ -70,19 +70,13 @@ func update_priorities() -> void:
print(get_priority_summary())
func apply_resource_delta(resource_id: StringName, amount: float) -> void:
match resource_id:
&"food":
food += amount
&"wood":
wood += amount
func apply_metric_delta(metric_id: StringName, amount: float) -> void:
match metric_id:
&"safety":
safety = clamp(safety + amount, 0.0, 100.0)
&"knowledge":
knowledge += amount
food = max(food, 0.0)
wood = max(wood, 0.0)
safety = clamp(safety, 0.0, 100.0)
knowledge = max(knowledge, 0.0)