package content import ( "fmt" "math" ) type EntranceRules struct { HousingX float64 `yaml:"housingX"` HousingZ float64 `yaml:"housingZ"` } func (r EntranceRules) Validate() error { if !finiteRange(r.HousingX, -64, 64) || !finiteRange(r.HousingZ, -64, 64) || math.Hypot(r.HousingX, r.HousingZ) < 6 { return fmt.Errorf("housing entrance must be near, but separate from, the central world portal") } return nil }