1
0
Fork 0
generic/weightedrandom/new.go

12 Zeilen
276 B
Go

package weightedrandom
// New returns an new instance of WeightRandom
func New[T any](af AdjustFunc, rf RandomFunc, acf AccessModifier) *WeightRandom[T] {
return &WeightRandom[T]{
data: []*weightitem[T]{},
weightFunc: af,
randomFunc: rf,
accessfunc: acf,
}
}