aboutsummaryrefslogtreecommitdiff
path: root/internal/world/grid.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/world/grid.go')
-rw-r--r--internal/world/grid.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/world/grid.go b/internal/world/grid.go
index 837f737..2ea897a 100644
--- a/internal/world/grid.go
+++ b/internal/world/grid.go
@@ -32,12 +32,15 @@ type RoomGrid struct {
// are then not followed, but any coordinate already assigned to it stands.
// - include, when non-nil, restricts placement to targets for which it returns
// true (pass nil to place every reachable target).
+// - edgeInclude, when non-nil, restricts traversal to exits for which it
+// returns true (pass nil to follow every exit whose target passes include).
+// It receives (fromRoomID, dir, targetRoomID) and is checked before include.
// - onConflict, when non-nil, is called for each twist/overlap encountered.
//
// The first assignment to a room or cell always wins; conflicting placements are
// skipped. In a world that passes grid validation there are no conflicts, so the
// layout is unambiguous.
-func BuildGrid(seed int, load func(int) (*Room, bool), include func(int) bool, onConflict func(GridConflict)) RoomGrid {
+func BuildGrid(seed int, load func(int) (*Room, bool), include func(int) bool, edgeInclude func(int, ExitDir, int) bool, onConflict func(GridConflict)) RoomGrid {
g := RoomGrid{
Coord: map[int][3]int{seed: {0, 0, 0}},
RoomAt: map[[3]int]int{{0, 0, 0}: seed},