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:
Takeshi
2026-10-11 15:58:00 +09:00
parent 39f6068461
commit b84bade045
235 changed files with 495831 additions and 312 deletions
+13 -12
View File
@@ -191,8 +191,8 @@ func get_quarantine_reason() -> StringName:
return _quarantine_reason
func get_base_walkable_cells() -> Array[Vector3i]:
return _sorted_cells(_base_walkable_cells.keys())
func get_base_walkable_cells(sort_result := true) -> Array[Vector3i]:
return _sorted_cells(_base_walkable_cells.keys(), sort_result)
func get_projected_route_cells() -> Array[Vector3i]:
@@ -563,7 +563,7 @@ func _projection_status_internal() -> Dictionary:
}
var current_source_revision := _source.get_revision_for_category(_source.CATEGORY_ROUTE)
var current_route_cells := _source.get_route_cells()
var path_capture := _capture_path_state(_path)
var path_capture := _capture_path_state(_path, false)
var source_changed: bool = (
current_source_revision != source_revision
or current_route_cells != _projected_route_cells
@@ -573,7 +573,7 @@ func _projection_status_internal() -> Dictionary:
or path_capture[&"cells"] != _projected_walkable_cells
)
var projection_crosslink_ok: bool = (
_union_cells(get_base_walkable_cells(), _projected_route_cells)
_union_cells(get_base_walkable_cells(false), _projected_route_cells)
== _projected_walkable_cells
)
return {
@@ -690,7 +690,7 @@ func _quarantine(reason: StringName) -> void:
_transaction_active = false
static func _capture_path_state(path_service: PathService) -> Dictionary:
static func _capture_path_state(path_service: PathService, capture_snapshot := true) -> Dictionary:
var snapshot := path_service.create_snapshot()
var parsed_cells := _path_cells_from_snapshot(snapshot)
if not bool(parsed_cells[&"ok"]):
@@ -701,11 +701,11 @@ static func _capture_path_state(path_service: PathService) -> Dictionary:
&"ok": false,
&"message": "Path snapshot topology has not been materialized into the live graph.",
}
return {
&"ok": true,
&"snapshot": snapshot.duplicate(true),
&"cells": (parsed_cells[&"cells"] as Array).duplicate(),
}
var result := {&"ok": true}
if capture_snapshot:
result[&"snapshot"] = snapshot.duplicate(true)
result[&"cells"] = (parsed_cells[&"cells"] as Array).duplicate()
return result
static func _path_cells_from_snapshot(snapshot: Dictionary) -> Dictionary:
@@ -1072,14 +1072,15 @@ static func _union_cells(first: Array, second: Array) -> Array[Vector3i]:
return _sorted_cells(union.keys())
static func _sorted_cells(source: Variant) -> Array[Vector3i]:
static func _sorted_cells(source: Variant, sort_result := true) -> Array[Vector3i]:
var result: Array[Vector3i] = []
if not source is Array:
return result
for raw_cell: Variant in source:
if raw_cell is Vector3i:
result.append(raw_cell)
result.sort_custom(_cell_less)
if sort_result:
result.sort_custom(_cell_less)
return result