aboutsummaryrefslogtreecommitdiff
path: root/internal/game/map_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/map_test.go')
-rw-r--r--internal/game/map_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/game/map_test.go b/internal/game/map_test.go
index 159214c..2fe9c1e 100644
--- a/internal/game/map_test.go
+++ b/internal/game/map_test.go
@@ -29,10 +29,10 @@ func writeTempRoom(t *testing.T, dir string, id int, body string) {
// links draw a bar, one-way links draw a directional arrow, outward-blocked
// links draw a blocked 'X', and links with no traversable direction draw 'X'.
func TestMapConnectorGlyphs(t *testing.T) {
- const condEast = "name: One\nexits:\n east:\n room: 2\n condition:\n flag: gate_open\n"
- const condSouth = "name: Three\nexits:\n south:\n room: 2\n condition:\n flag: gate_open\n"
- const condNE = "name: One\nexits:\n northeast:\n room: 2\n condition:\n flag: gate_open\n"
- const condSE = "name: One\nexits:\n southeast:\n room: 2\n condition:\n flag: gate_open\n"
+ const condEast = "name: One\nexits:\n east:\n room: 2\n condition:\n global_flag: gate_open\n"
+ const condSouth = "name: Three\nexits:\n south:\n room: 2\n condition:\n global_flag: gate_open\n"
+ const condNE = "name: One\nexits:\n northeast:\n room: 2\n condition:\n global_flag: gate_open\n"
+ const condSE = "name: One\nexits:\n southeast:\n room: 2\n condition:\n global_flag: gate_open\n"
cases := []struct {
name string
@@ -161,9 +161,9 @@ func TestMapConnectorGlyphs(t *testing.T) {
writeTempRoom(t, dir, 4, tc.room4)
}
- g := &Game{Deps: Deps{World: world.New(dir)}, Flags: NewFlagStore()}
+ g := &Game{Deps: Deps{World: world.New(dir)}, GlobalFlags: NewGlobalFlagStore()}
if tc.flagOpen {
- g.Flags.Set("gate_open", true)
+ g.GlobalFlags.Set("gate_open", true)
}
sess := &net.Session{Player: &player.Player{Flags: map[string]any{}}}
@@ -401,7 +401,7 @@ func TestMap3DDisconnectedComponent(t *testing.T) {
writeTempRoom(t, dir, 3, "name: Tower Two Base\nexits:\n up: 4\n west: 2\n")
writeTempRoom(t, dir, 4, "name: Tower Two\nexits:\n down: 3\n")
- g := &Game{Deps: Deps{World: world.New(dir)}, Flags: NewFlagStore()}
+ g := &Game{Deps: Deps{World: world.New(dir)}, GlobalFlags: NewGlobalFlagStore()}
mg := mapGlyphsForPlayer(false)
// Player has only visited tower 1. Tower 2 should appear but dimmed (unvisited).
@@ -426,7 +426,7 @@ func TestMap3DDifferentZExcluded(t *testing.T) {
writeTempRoom(t, dir, 1, "name: Ground\nexits:\n up: 2\n")
writeTempRoom(t, dir, 2, "name: Upper\nexits:\n down: 1\n")
- g := &Game{Deps: Deps{World: world.New(dir)}, Flags: NewFlagStore()}
+ g := &Game{Deps: Deps{World: world.New(dir)}, GlobalFlags: NewGlobalFlagStore()}
mg := mapGlyphsForPlayer(false)
sess := &net.Session{Player: &player.Player{
Stats: player.PlayerStats{RoomsVisited: map[int]bool{1: true, 2: true}},