Files
vRp.CD2g_test/utils/g2d/radiation_pattern_options.go
2023-06-06 13:32:16 +08:00

15 lines
482 B
Go

package g2d
type RadiationPatternOption[ItemType comparable, Item RadiationPatternItem[ItemType]] func(rp *RadiationPattern[ItemType, Item])
func WithRadiationPatternExclude[ItemType comparable, Item RadiationPatternItem[ItemType]](itemType ...ItemType) RadiationPatternOption[ItemType, Item] {
return func(rp *RadiationPattern[ItemType, Item]) {
if rp.excludes == nil {
rp.excludes = map[ItemType]bool{}
}
for _, t := range itemType {
rp.excludes[t] = true
}
}
}