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
+5 -3
View File
@@ -57,10 +57,12 @@ func get_total_amount() -> float:
return total
func get_available_capacity() -> float:
return maxf(float(data["capacity"]) - get_total_amount(), 0.0)
func deposit(item_id: StringName, requested_amount: float) -> float:
var accepted := minf(
maxf(requested_amount, 0.0), maxf(float(data["capacity"]) - get_total_amount(), 0.0)
)
var accepted := minf(maxf(requested_amount, 0.0), get_available_capacity())
if accepted <= 0.0:
return 0.0
data["amounts"][String(item_id)] = get_amount(item_id) + accepted