Add supply auto-purchase and preserve save recovery state

This commit is contained in:
Takeshi
2026-10-02 07:35:03 +09:00
parent 285528b7a3
commit 39f6068461
44 changed files with 2625 additions and 61 deletions
+8
View File
@@ -0,0 +1,8 @@
extends RefCounted
## A genuine pre-v14 fixture must have no player automatic purchase intent.
static func strip_empty(data: Dictionary) -> void:
assert(data.has(&"auto_purchase_plans"))
var plans: Dictionary = data[&"auto_purchase_plans"]
assert(plans[&"version"] == 1 and (plans[&"plans"] as Array).is_empty())
data.erase(&"auto_purchase_plans")
+1
View File
@@ -0,0 +1 @@
uid://dqjyetek8aurm
+1
View File
@@ -2,6 +2,7 @@ extends RefCounted
## Build a genuine pre-v10 fixture only when no upkeep ledger history exists.
static func strip_empty_upkeep(data: Dictionary) -> void:
preload("res://tests/fixtures/pre_auto_purchase_runtime.gd").strip_empty(data)
for entry: Dictionary in data[&"economy"][&"entries"]:
assert(String(entry.get(&"category", "")) not in ["MAINTENANCE_ACCRUAL", "MAINTENANCE_PAYMENT"])
data.erase(&"weather")