extends SceneTree func _initialize() -> void: call_deferred("run") func run() -> void: var runtime: Variant = root.get_node("SimulationRuntime") var path := PathService.new() var cells: Array[Vector3i] = [] for x in 100: for y in 20: cells.append(Vector3i(x,y,0)) path.rebuild_graph(cells) var cases: Array = [cells, [], cells.slice(1), cells.duplicate(), cells.duplicate()] cases[3][0] = cells[1] cases[4][0] = Vector3i(-1,0,0) var reverse := cells.duplicate();reverse.reverse();cases.append(reverse) var before := path.create_snapshot() var failures := 0 for candidate: Array in cases: var typed: Array[Vector3i] = [];typed.assign(candidate) var reference: bool = runtime._path_snapshot_cells_match_world(path.create_snapshot(),typed) if path.matches_passable_cells(typed) != reference:failures+=1;push_error("membership differs from snapshot check") if path.create_snapshot()!=before:failures+=1;push_error("membership mutated path state") path.rebuild_graph([]) if not path.matches_passable_cells([]):failures+=1;push_error("empty graphs must match") print("Path membership: 8 checks, %d failures" % failures) quit(failures)