public void Run() { // Test: Roll dice several times, and run all evaluators for each roll for (int i = 0; i < 1000; i++) { // Roll dice _cup.Shake(); // Pick up evaluations DiceEvaluation diceEval = new DiceEvaluation(_cup.DiceFaceValues); // Run each evaluator against the dice foreach (var eval in _diceEvaluators) { string evalDescription = eval.Key; IDiceEvaluator iDiceEval = eval.Value; int points = iDiceEval.Evaluate(_cup.DiceCountByFaceValue); diceEval.AddEvaluation(evalDescription, points); } // Add this evaluation to stats _evaluationStats.AddEvaluation(diceEval); } // Print total evaluations Console.WriteLine(_evaluationStats); // Console.WriteLine(_evaluationStats.FilterStats(new List<string>{ "Tower" })); }
public void Run() { // Test: Roll dice 10 times, and run all evaluators for each roll for (int i = 0; i < 10; i++) { // Roll and print dice _cup.Shake(); Console.WriteLine(_cup); // Run each evaluator against the dice foreach (var eval in _diceEvaluators) { string evalDescription = eval.Key; IDiceEvaluator diceEval = eval.Value; Console.WriteLine($"{evalDescription} evaluated to {diceEval.Evaluate(_cup.DiceCountByValue)} points"); } Console.WriteLine(); } }