Esempio n. 1
0
 internal SingleSelector(WeightedSelector <T> weightedSelector) : base(weightedSelector)
 {
 }
Esempio n. 2
0
 internal MultipleSelector(WeightedSelector <T> weightedSelector) : base(weightedSelector)
 {
 }
Esempio n. 3
0
 public static List <WeightedItem <T> > OrderByWeightAscending <T>(this WeightedSelector <T> selector)
 {
     return(selector.Items.OrderBy(item => item.Weight).ToList());
 }
Esempio n. 4
0
 public static int TotalWeight <T>(this WeightedSelector <T> selector)
 {
     return(selector.Items.Count == 0 ? 0 : selector.Items.Sum(t => t.Weight));
 }
Esempio n. 5
0
 internal SelectorBase(WeightedSelector <T> weightedSelector)
 {
     WeightedSelector = weightedSelector;
 }