diff options
| author | historia <[not public]> | 2026-10-05 19:20:17 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-10-05 19:20:17 -0400 |
| commit | 1091d0fae96d152c11aec1bb2dd949f51ed5aa1e (patch) | |
| tree | 0d867d42726cd3910c9851ec69e15b9a4b031001 /internal/world/grid.go | |
| parent | 9d8c43cd68c960b9a6b8f781684f763e204a4498 (diff) | |
| download | thehouseoficarus-1091d0fae96d152c11aec1bb2dd949f51ed5aa1e.tar.gz | |
feat: shared tls cert, validation fixes
Diffstat (limited to 'internal/world/grid.go')
| -rw-r--r-- | internal/world/grid.go | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/internal/world/grid.go b/internal/world/grid.go index 9773241..5229273 100644 --- a/internal/world/grid.go +++ b/internal/world/grid.go @@ -2,15 +2,22 @@ // their spawns, and ground items — the spatial state of Vesta. package world +// GridConflictKind identifies the kind of grid layout conflict. +type GridConflictKind string + +const ( + // GridConflictTwist: one room is forced onto two different grid cells (it + // was already placed at Existing but a later exit wants it at Want). + GridConflictTwist GridConflictKind = "twist" + // GridConflictOverlap: two distinct rooms want the same grid cell + // (Occupier already holds Want). + GridConflictOverlap GridConflictKind = "overlap" +) + // GridConflict describes a layout conflict found while embedding rooms onto a // 3D grid via their exit deltas. -// -// - "twist": one room is forced onto two different grid cells (it was already -// placed at Existing but a later exit wants it at Want). -// - "overlap": two distinct rooms want the same grid cell (Occupier already -// holds Want). type GridConflict struct { - Kind string // "twist" or "overlap" + Kind GridConflictKind From int // room whose exit produced the conflict Dir ExitDir // exit direction taken from From Target int // room being placed @@ -76,7 +83,7 @@ func BuildGrid(seed int, load func(int) (*Room, bool), include func(int) bool, e if existing, seen := g.Coord[target]; seen { if existing != want && onConflict != nil { onConflict(GridConflict{ - Kind: "twist", From: rid, Dir: dir, + Kind: GridConflictTwist, From: rid, Dir: dir, Target: target, Want: want, Existing: existing, }) } @@ -85,7 +92,7 @@ func BuildGrid(seed int, load func(int) (*Room, bool), include func(int) bool, e if occupier, used := g.RoomAt[want]; used && occupier != target { if onConflict != nil { onConflict(GridConflict{ - Kind: "overlap", From: rid, Dir: dir, + Kind: GridConflictOverlap, From: rid, Dir: dir, Target: target, Want: want, Occupier: occupier, }) } |
