package game import ( "fmt" "strings" "thehouseoficarus/internal/player" "thehouseoficarus/internal/world" ) // hiddenExitFlagPrefix is the canonical prefix for discovered-exit player flags // ("hidden_exit__"). Shared by discoveredExitFlag, the // hideallexits admin command, and the room-ID migration in exit_migrate.go so // the format never drifts between writers and readers. const hiddenExitFlagPrefix = "hidden_exit_" func discoveredExitFlag(roomID int, dir world.ExitDir) string { return fmt.Sprintf("%s%d_%s", hiddenExitFlagPrefix, roomID, strings.ToLower(string(dir))) } func (g *Game) exitDiscovered(p *player.Player, roomID int, dir world.ExitDir) bool { if p.GodMode { return true } return getPlayerFlagInt(p, discoveredExitFlag(roomID, dir)) != 0 } func (g *Game) markExitDiscovered(p *player.Player, roomID int, dir world.ExitDir) { g.setPlayerFlag(p, discoveredExitFlag(roomID, dir), 1) }