diff options
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 { |
