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