aboutsummaryrefslogtreecommitdiff
path: root/internal/admin/api_room_courses.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-09 22:15:54 -0400
committerhistoria <[not public]>2026-07-09 22:15:54 -0400
commitecba7f726f70b37126d852c38c7e3eec7b04d730 (patch)
tree9129215c6e5015336fde1116395336d82bb952d1 /internal/admin/api_room_courses.go
parentb3d4c616f59ad2519f3a0b77e3b47d6571cd2486 (diff)
downloadthehouseoficarus-ecba7f726f70b37126d852c38c7e3eec7b04d730.tar.gz
feat: old standalone trigger systems completely unified into trigger->condition->action system
Diffstat (limited to 'internal/admin/api_room_courses.go')
-rw-r--r--internal/admin/api_room_courses.go24
1 files changed, 10 insertions, 14 deletions
diff --git a/internal/admin/api_room_courses.go b/internal/admin/api_room_courses.go
index e4cf849..097b9e8 100644
--- a/internal/admin/api_room_courses.go
+++ b/internal/admin/api_room_courses.go
@@ -290,15 +290,15 @@ func (s *AdminServer) handleRoomCourse(w http.ResponseWriter, r *http.Request, r
m["id"] = id
delete(m, "_raw")
writeJSON(w, map[string]any{
- "course": m,
- "course_id": id,
- "course_name": m["name"],
- "obstacle_index": idx,
- "total_obstacles": len(obstacles),
- "obstacle": obstacles[idx],
- "obstacles": obstacles,
- "_raw": string(raw),
- "room_id": roomID,
+ "course": m,
+ "course_id": id,
+ "course_name": m["name"],
+ "obstacle_index": idx,
+ "total_obstacles": len(obstacles),
+ "obstacle": obstacles[idx],
+ "obstacles": obstacles,
+ "_raw": string(raw),
+ "room_id": roomID,
})
return
}
@@ -565,8 +565,6 @@ func exitIsAlwaysBlocked(v any) bool {
return false
}
-
-
// isHorizontalDir returns whether d is one of the 8 horizontal directions.
func isHorizontalDir(d string) bool {
for _, h := range horizontalExitDirs {
@@ -577,8 +575,6 @@ func isHorizontalDir(d string) bool {
return false
}
-
-
// reconcileExitOnRoom validates that roomID has an exit in dir.
// If expectedTarget > 0, also checks the exit points to that room.
// Returns an error string or empty string on success.
@@ -627,4 +623,4 @@ func (s *AdminServer) reconcileCourseExits(m map[string]any) []string {
}
return warnings
-} \ No newline at end of file
+}