public static T GetRandomElementWeighted <T>(
     this IReadOnlyList <T> e,
     Func <T, float> randomWeights)
 {
     return(e.Count != 0 ? MBRandom.ChooseWeighted <T>((IEnumerable <T>)e, randomWeights) : throw new ArgumentException());
 }
 public static T ChooseWeighted <T>(IEnumerable <T> candidates, Func <T, float> weightFunction) => MBRandom.ChooseWeighted <T>(candidates, weightFunction, out int _);