Save The Tree implementation and acceptance work in progress
Preserve production code, regression fixtures, audio assets and provenance, test infrastructure, and the original-completion plan and progress ledger. Final game and Windows acceptance remain pending; excluded local artifacts and native experiments are not part of this snapshot.
This commit is contained in:
@@ -7,6 +7,7 @@ var _state: Variant
|
||||
var _runtime: Variant
|
||||
var _facility_id: StringName
|
||||
var _facility_inventory_id: StringName
|
||||
var _kitchen_fixture_gold := 0
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
@@ -52,6 +53,7 @@ func _cleanup() -> void:
|
||||
_runtime = null
|
||||
_clock = null
|
||||
_state = null
|
||||
_kitchen_fixture_gold = 0
|
||||
|
||||
|
||||
func _build_operational_cafeteria() -> void:
|
||||
@@ -71,6 +73,9 @@ func _build_operational_cafeteria() -> void:
|
||||
_expect(_runtime.economy_service.has_account(StringName("FACILITY_REVENUE:%s" % _facility_id)), "facility receives a dedicated revenue account")
|
||||
_expect(not _runtime.mana_network_service.get_node(_facility_id).is_empty(), "Mana demand is registered for the completed facility")
|
||||
_facility_inventory_id = operational.local_inventory_id
|
||||
var kitchen_setup: Dictionary = load("res://tests/fixtures/required_kitchen_setup.gd").ensure(_runtime, _clock, _facility_id, false)
|
||||
_expect(bool(kitchen_setup.get(&"ok", false)), "public paid kitchen setup/link for logical-attendance S2 fixture")
|
||||
_kitchen_fixture_gold = int(kitchen_setup.get(&"gold_cost", -1))
|
||||
var staffing = _runtime.submit_command(
|
||||
&"set_facility_conditions",
|
||||
{&"facility_id": _facility_id, &"conditions": {&"active_staff_ids": [&"cook_1", &"server_1"]}},
|
||||
@@ -78,8 +83,8 @@ func _build_operational_cafeteria() -> void:
|
||||
)
|
||||
_expect(staffing.is_success(), "two active staff can be assigned through a command")
|
||||
_expect(operational.state == FacilityInstance.State.OPEN, "staffed and powered cafeteria becomes operational")
|
||||
_expect(_state.get_resource(&"gold") == 4200, "construction Gold is paid once through the authoritative ledger")
|
||||
_expect(_runtime.economy_service.get_balance(&"CONSTRUCTION_EXPENSE") == 800, "construction counter-account retains the capital flow")
|
||||
_expect(_state.get_resource(&"gold") == 4200 - _kitchen_fixture_gold, "construction Gold is paid once through the authoritative ledger")
|
||||
_expect(_runtime.economy_service.get_balance(&"CONSTRUCTION_EXPENSE") == 800 + _kitchen_fixture_gold, "construction counter-account retains the capital flow")
|
||||
|
||||
|
||||
func _deliver_inputs_through_logistics() -> void:
|
||||
@@ -193,8 +198,8 @@ func _run_service_sale_with_round_trip() -> void:
|
||||
_expect(completed != null and completed.state == ServiceInstance.State.COMPLETED, "three active minutes complete the service")
|
||||
_expect(_runtime.inventory_service.total_quantity(_facility_inventory_id, &"ingredient/basic_meal") == 1, "completion consumes exactly one reserved ingredient")
|
||||
_expect(_runtime.economy_service.get_balance(&"GUEST_WALLET:guest_1") == 75, "guest pays the immutable quoted price")
|
||||
_expect(_runtime.economy_service.get_balance(&"PLAYER_CASH") == 4225, "service cash sweep increases player Gold")
|
||||
_expect(_state.get_resource(&"gold") == 4225, "UI Gold mirror follows the ledger transaction")
|
||||
_expect(_runtime.economy_service.get_balance(&"PLAYER_CASH") == 4225 - _kitchen_fixture_gold, "service cash sweep increases player Gold")
|
||||
_expect(_state.get_resource(&"gold") == 4225 - _kitchen_fixture_gold, "UI Gold mirror follows the ledger transaction")
|
||||
_expect(_runtime.economy_service.validate_ledger()[&"ok"], "service sale remains double-entry balanced")
|
||||
var saw_completion := false
|
||||
for event in _runtime.domain_events.recent_events():
|
||||
|
||||
Reference in New Issue
Block a user