feat(sites): typed dive site definition with placements and routes

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
OlivierandClaude Haiku 4.5 committed 2026-10-06 19:52:24 +02:00
1 parent 1c1f0b87da
commit 506f6dd0c8
5 files changed
+255 -2

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
class_name SiteRoute
extends Resource
@export var route_id: StringName
@export var waypoints_m := PackedVector3Array()
@export var maximum_depth_m: float = 0.0
func validation_error() -> String:
if route_id.is_empty():
return "route id is empty"
if waypoints_m.size() < 2:
return "route needs at least two waypoints"
if not is_finite(maximum_depth_m) or maximum_depth_m <= 0.0:
return "route maximum depth must be positive"
for waypoint: Vector3 in waypoints_m:
if not (is_finite(waypoint.x) and is_finite(waypoint.y) and is_finite(waypoint.z)):
return "route waypoints must be finite"
if -waypoint.y > maximum_depth_m:
return "route waypoint exceeds the route maximum depth"
return ""