feat: add typed pantry storage site
This commit is contained in:
@@ -116,6 +116,17 @@ func _run() -> void:
|
||||
ids == ["berry_bush_01", "berry_bush_02", "tree_01", "tree_02"],
|
||||
"Jajce resources should preserve all stable IDs"
|
||||
)
|
||||
_check(world.has_node("WorldObjects/StorageSites"), "JajceWorld should expose StorageSites")
|
||||
var pantry := world.get_node("WorldObjects/StorageSites/VillagePantry") as StorageNode
|
||||
_check(pantry != null, "JajceWorld should include a typed VillagePantry StorageNode")
|
||||
_check(
|
||||
pantry.storage_id == SimulationIds.STORAGE_VILLAGE_PANTRY,
|
||||
"VillagePantry should preserve the stable storage ID"
|
||||
)
|
||||
_check(
|
||||
not world.has_node("LegacyActivityMarkers/PantryMarker"),
|
||||
"Pantry should no longer be a legacy activity marker"
|
||||
)
|
||||
|
||||
var navigation_region := world.get_node("NavigationRegion3D") as NavigationRegion3D
|
||||
var navigation_map: RID = NavigationServer3D.region_get_map(navigation_region.get_rid())
|
||||
@@ -131,6 +142,7 @@ func _run() -> void:
|
||||
var destinations: Array[Vector3] = []
|
||||
for resource in resources:
|
||||
destinations.append((resource as ResourceNode).interaction_point.global_position)
|
||||
destinations.append(pantry.get_interaction_position())
|
||||
for marker in world.get_node("LegacyActivityMarkers").get_children():
|
||||
destinations.append((marker as Marker3D).global_position)
|
||||
|
||||
@@ -143,6 +155,7 @@ func _run() -> void:
|
||||
)
|
||||
|
||||
var adapter := ActiveWorldAdapter.new()
|
||||
adapter.pantry_storage = pantry
|
||||
root.add_child(adapter)
|
||||
var manager: Node = load("res://simulation/SimulationManager.gd").new()
|
||||
manager.debug_logs = false
|
||||
@@ -164,10 +177,20 @@ func _run() -> void:
|
||||
"Selected Jajce resource should be authoritatively reserved"
|
||||
)
|
||||
manager.release_resource(selected.node_id, npc.id)
|
||||
var storage_target := adapter.get_activity_target(SimulationIds.ACTION_WITHDRAW_FOOD)
|
||||
_check(
|
||||
storage_target.get("target_id", "") == String(SimulationIds.STORAGE_VILLAGE_PANTRY),
|
||||
"Storage actions should target the typed pantry's stable ID"
|
||||
)
|
||||
var storage_target_position: Vector3 = storage_target.get("position", Vector3(9999, 9999, 9999))
|
||||
_check(
|
||||
storage_target_position.distance_to(pantry.get_interaction_position()) < 0.01,
|
||||
"Storage actions should use the pantry StorageNode interaction point"
|
||||
)
|
||||
|
||||
if failures.is_empty():
|
||||
print(
|
||||
"[TEST] Jajce scaffold passed: Terrain3D, 6 textures, shader water, building blockouts, chimney smoke"
|
||||
"[TEST] Jajce scaffold passed: Terrain3D, storage site, shader water, building blockouts"
|
||||
)
|
||||
quit(0)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user