Esempio n. 1
0
        public object PickOne(params WeightedOption[] weightedOptions)
        {
            var castedOptions = weightedOptions.Select(wo => WeightedOption <object> ._(wo.Weight, wo.Obj));
            var result        = PickOne <object>(castedOptions.ToArray());

            return(result);
        }
Esempio n. 2
0
        public static WeightedOption <T> _(double weight, T obj)
        {
            var result = new WeightedOption <T>()
            {
                Weight = weight,
                Obj    = obj
            };

            return(result);
        }