diff options
| author | historia <[not public]> | 2026-06-29 17:19:40 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-29 17:19:40 -0400 |
| commit | feb80b7dde200d4121cd9f9c583a08f9869c5588 (patch) | |
| tree | 3271cae1d74c8f3b84ef3ae84f8f62e563029dff /internal/validate/checks.go | |
| parent | c6cbf76b33ac20d071d25e74b70f6901476193a6 (diff) | |
| download | thehouseoficarus-feb80b7dde200d4121cd9f9c583a08f9869c5588.tar.gz | |
feat: incardinal directions (nw, ne, sw, se). probably janky in ways I haven't yet discovered.
Diffstat (limited to 'internal/validate/checks.go')
| -rw-r--r-- | internal/validate/checks.go | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/internal/validate/checks.go b/internal/validate/checks.go index 87c078e..a41ad86 100644 --- a/internal/validate/checks.go +++ b/internal/validate/checks.go @@ -45,12 +45,14 @@ func validateRooms(s Source) []Issue { for dir, exit := range room.Exits { switch dir { - case world.North, world.South, world.East, world.West, world.Up, world.Down: + case world.North, world.South, world.East, world.West, + world.Northeast, world.Northwest, world.Southeast, world.Southwest, + world.Up, world.Down: default: issues = append(issues, Issue{ Level: "ERROR", Type: "reference", - Message: fmt.Sprintf("Room %d: invalid exit direction %q (only north/south/east/west/up/down supported)", id, dir), + Message: fmt.Sprintf("Room %d: invalid exit direction %q (only n/s/e/w/ne/nw/se/sw/up/down supported)", id, dir), }) continue } @@ -867,15 +869,6 @@ func validateRoomWiring(s Source) []Issue { return issues } -// gridDeltas maps the horizontal exits to their grid movement. Up/Down are -// intentionally excluded: they connect separate horizontal planes rather than -// moving within one. -var gridDeltas = map[world.ExitDir][2]int{ - world.North: {0, -1}, - world.South: {0, 1}, - world.East: {1, 0}, - world.West: {-1, 0}, -} // validateRoomGrid lays each reachable horizontal plane on a 2D grid starting // from the configured root rooms and reports when the exit layout cannot be @@ -933,7 +926,7 @@ func validateRoomGrid(s Source) []Issue { continue } - d := gridDeltas[dir] + d := world.DirectionDeltas[dir] want := [2]int{c[0] + d[0], c[1] + d[1]} if existing, ok := coordOf[target]; ok { |
