feat: deliver emergent Jajce commitments

This commit is contained in:
Rijad Zuzo
2026-08-12 21:15:58 +02:00
parent dc0f59fcf0
commit 6b50580598
28 changed files with 2145 additions and 206 deletions
+9 -4
View File
@@ -181,7 +181,7 @@ func test_commitments_fulfill_break_release_and_supersede() -> void:
)
)
var supplied_events := WorldEventStore.new()
assert_true(supplied_events.append(_pantry_supply(9, 12)))
assert_true(supplied_events.append(_pantry_supply(9, 12, SimulationIds.PLAYER_ACTOR_ID)))
assert_eq(commitments.maintain(12, system, supplied_events, _pantry_facts(1.0)), [fulfilled])
assert_eq(fulfilled.get_status(), CommitmentStateRecord.STATUS_FULFILLED)
assert_eq(fulfilled.get_cause_event_id(), 9)
@@ -267,13 +267,18 @@ func _pantry_facts(amount: float) -> Dictionary:
}
func _pantry_supply(event_id: int, tick: int) -> WorldEventRecord:
func _pantry_supply(event_id: int, tick: int, actor_id: int = 3) -> WorldEventRecord:
var source_id := (
&"player_inventory"
if actor_id == SimulationIds.PLAYER_ACTOR_ID
else StringName("npc_inventory_%d" % actor_id)
)
var economic := EconomicEventRecord.create(
event_id,
&"storage_deposited",
tick,
3,
&"npc_inventory_3",
actor_id,
source_id,
&"village_pantry",
&"food",
1.0,