1package gen 2 3import ( 4 "fmt" 5 6 "tinyadventure/internal/model" 7) 8 9func hilltop(m *model.Map, c [2]int) bool { 10 return m.Hex(c[0], c[1])[0] == model.ShapeHill && summit(m, c) 11} 12 13func placeLandmarks(p *placer) []model.Landmark { 14 var out []model.Landmark 15 add := func(kind string, cs [][2]int) { 16 for _, c := range cs { 17 out = append(out, model.Landmark{ID: fmt.Sprintf("lm%d", len(out)+1), Kind: kind, X: c[0], Y: c[1]}) 18 } 19 } 20 add("lookout", p.take(5, 8, func(c [2]int) bool { return hilltop(p.m, c) })) 21 add("shrine", p.take(3, 10, func([2]int) bool { return true })) 22 add("cache", p.take(5, 6, func([2]int) bool { return true })) 23 return out 24}