feat: add missing wood opportunities

This commit is contained in:
Rijad Zuzo
2026-07-16 01:50:19 +02:00
parent f82d9683de
commit 79dd503343
26 changed files with 1054 additions and 175 deletions
@@ -457,6 +457,27 @@ func _test_previous_world_opportunity_migration() -> void:
),
"World v7 migration should initialize deterministic opportunity identity"
)
var v8_data: Dictionary = _build_opportunity_world(manager, false)
v8_data["schema_version"] = SimulationStateRecord.OPPORTUNITY_LEGACY_SCHEMA_VERSION
var legacy_opportunity: Dictionary = v8_data["opportunities"][0]
legacy_opportunity["schema_version"] = OpportunityStateRecord.LEGACY_SCHEMA_VERSION
legacy_opportunity.erase("closed_tick")
legacy_opportunity.erase("invalidation_reason")
for event_data in v8_data["economic_events"]:
event_data["schema_version"] = EconomicEventRecord.POSITION_LEGACY_SCHEMA_VERSION
event_data.erase("action_id")
event_data.erase("required_amount")
var migrated_v8 := SimulationStateRecord.from_dictionary(v8_data)
_check(migrated_v8 != null, "World schema v8 should preserve its pantry opportunity history")
if migrated_v8 != null:
_check(
(
migrated_v8.opportunities.size() == 1
and migrated_v8.opportunities[0].get_status() == OpportunityStateRecord.STATUS_OPEN
and migrated_v8.opportunities[0].get_closed_tick() == -1
),
"World v8 migration should normalize the nested opportunity lifecycle fields"
)
manager.free()