feat: author resource-aware riverbank grove
This commit is contained in:
@@ -519,9 +519,10 @@ func _run() -> void:
|
||||
),
|
||||
"Runtime should not retain duplicate flat-world objects"
|
||||
)
|
||||
var resource_root := main_scene.get_node("JajceWorld/WorldObjects/ResourceNodes")
|
||||
var runtime_resources := _collect_resource_nodes(main_scene.get_node("JajceWorld/WorldObjects"))
|
||||
_check(
|
||||
resource_root.get_child_count() == 18, "Runtime should contain eighteen Jajce ResourceNodes"
|
||||
runtime_resources.size() == 18,
|
||||
"Runtime should contain eighteen Jajce ResourceNodes across authored clusters"
|
||||
)
|
||||
_check(
|
||||
simulation_manager.resource_states.size() == 18,
|
||||
@@ -597,8 +598,8 @@ func _run() -> void:
|
||||
for site in activity_root.get_children():
|
||||
destinations.append((site as ActivitySite).get_interaction_position())
|
||||
|
||||
for resource in resource_root.get_children():
|
||||
destinations.append((resource as ResourceNode).interaction_point.global_position)
|
||||
for resource in runtime_resources:
|
||||
destinations.append(resource.interaction_point.global_position)
|
||||
|
||||
for origin in fixed_origins:
|
||||
for destination in destinations:
|
||||
@@ -673,6 +674,16 @@ func _check(condition: bool, message: String) -> void:
|
||||
failures.append(message)
|
||||
|
||||
|
||||
func _collect_resource_nodes(parent: Node) -> Array[ResourceNode]:
|
||||
var resources: Array[ResourceNode] = []
|
||||
for child in parent.get_children():
|
||||
if child is ResourceNode:
|
||||
resources.append(child)
|
||||
else:
|
||||
resources.append_array(_collect_resource_nodes(child))
|
||||
return resources
|
||||
|
||||
|
||||
func _check_path_tracks_terrain(
|
||||
terrain: Terrain3D, path: PackedVector3Array, message: String
|
||||
) -> void:
|
||||
|
||||
Reference in New Issue
Block a user