From 9292634f2f8d71a53879ff07e1330c671b207d51 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Mon, 6 Jul 2026 23:05:04 -0400 Subject: feat: split the concept of hidden and impassable exits. add player_flag for discovered hidden exits. --- internal/world/grid.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/world/grid.go') 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}, -- cgit v1.2.3