public static BindingList <WeightedNamedOutcome> AddNothingOutcome(BindingList <WeightedNamedOutcome> outcomes, int totalWeight, int usedWeight) { int nothingWeight = totalWeight - usedWeight; if (nothingWeight == 0) { return(outcomes); } WeightedNamedOutcome nothing = new WeightedNamedOutcome("Nothing", nothingWeight, false); outcomes.Add(nothing); return(outcomes); }
private static void ResetOccurance(WeightedNamedOutcome outcome) { outcome.Occurances = 0; }
public static double CalculateChanceToOccur(WeightedNamedOutcome outcome, int totalWeight) { return(GetPercentageXOfY(outcome.Weight, totalWeight)); }