package game

import "github.com/denisovdennis/autohero/internal/model"

// TownEffectiveLevel is the reference level for shop gear ilvl / quest bands (mid of town bracket).
func TownEffectiveLevel(t *model.Town) int {
	if t == nil {
		return 1
	}
	mid := (t.LevelMin + t.LevelMax) / 2
	if mid < 1 {
		return 1
	}
	return mid
}
