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