public static void CheckDistribution() { var calculator = new Calculator(new EfficiencyCalculator(), new LookupService()); var conditionService = new ConditionService(new RandomService(), calculator); Condition? condition = null; IList <Condition> conditions = new List <Condition>(); for (var i = 0; i < 100000; i++) { condition = conditionService.GetCondition(condition); conditions.Add(condition.Value); } var a = from c in conditions group c by c into g select new { Condition = g.Key, Count = g.Count(), Percent = (double)g.Count() / conditions.Count }; Console.WriteLine($"Condition: \t Count \t\t %"); foreach (var c in a.OrderBy(arg => arg.Condition)) { Console.WriteLine($"{c.Condition}\t\t {c.Count} \t\t {c.Percent * 100}"); } }
public static CraftTable CreateCraftTable(Recipe recipe, CraftMan craftMan, IProgressWatcher watcher = null) { var efficiencyCalculator = new EfficiencyCalculator(); var lookupService = new LookupService(); var calculator = new Calculator(efficiencyCalculator, lookupService); var buffCollector = new BuffCollector(); var randomService = new RandomService(); var condition = new ConditionService(randomService, calculator); var craftQualityCalculator = new CraftQualityCalculator(); return(new CraftTable(buffCollector, condition, randomService, calculator, lookupService, craftQualityCalculator, recipe, craftMan, watcher)); }