aboutsummaryrefslogtreecommitdiff
path: root/internal/validate
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-03 20:53:00 -0400
committerhistoria <[not public]>2026-07-03 20:53:00 -0400
commita5d4ead1795882d25da7eda53680d2a84590693d (patch)
tree747a0516e03f22fdf511e55ee4c4809d4a1acd78 /internal/validate
parent0dfd7bf19e800b67e03726c18cfa00e623d6b121 (diff)
downloadthehouseoficarus-a5d4ead1795882d25da7eda53680d2a84590693d.tar.gz
feat: admin map can add new and rename areas. works with empty directories now.
Diffstat (limited to 'internal/validate')
-rw-r--r--internal/validate/checks.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/internal/validate/checks.go b/internal/validate/checks.go
index ccf996c..974998a 100644
--- a/internal/validate/checks.go
+++ b/internal/validate/checks.go
@@ -1024,6 +1024,39 @@ func validateRoomGrid(s Source) []Issue {
}
}
+ onConf := func(origin int) func(c world.GridConflict) {
+ return func(c world.GridConflict) {
+ switch c.Kind {
+ case "twist":
+ issues = append(issues, Issue{
+ Level: "ERROR",
+ Type: "integrity",
+ Message: fmt.Sprintf(
+ "Grid twist: room %d (via %d %s) maps to (%d,%d,%d) but was already placed at (%d,%d,%d) [origin %d]",
+ c.Target, c.From, c.Dir, c.Want[0], c.Want[1], c.Want[2], c.Existing[0], c.Existing[1], c.Existing[2], origin),
+ })
+ case "overlap":
+ issues = append(issues, Issue{
+ Level: "ERROR",
+ Type: "integrity",
+ Message: fmt.Sprintf(
+ "Grid overlap: room %d (via %d %s) wants (%d,%d,%d), already used by room %d [origin %d]",
+ c.Target, c.From, c.Dir, c.Want[0], c.Want[1], c.Want[2], c.Occupier, origin),
+ })
+ }
+ }
+ }
+
+ for id := range roomIndex {
+ if placed[id] {
+ continue
+ }
+ grid := world.BuildGrid(id, load, include, onConf(id))
+ for rid := range grid.Coord {
+ placed[rid] = true
+ }
+ }
+
return issues
}