Example #1
0
 public static void MatchTest()
 {
     BreakdownCalculator diceCalculator = new BreakdownCalculator(new List <Die>()
     {
         //new Boost(),
         new Ability(),
         new Ability(),
         new Ability(),
         new Ability(),
         //new Proficiency(),
         //new Ability(),
         //new Ability(),
         //new Difficulty(),
         //new Difficulty(),
         new Difficulty(),
         new Difficulty(),
         new Difficulty(),
         new Difficulty()
     });
 }
Example #2
0
        /// <summary>
        /// Runs a series of tests to calculate the total output
        /// </summary>
        public static void SkillBreakdown()
        {
            StreamWriter writer = new StreamWriter("DiceResults.csv");

            List <DieResult> resultList = new List <DieResult>();

            //each ability level
            for (int i = 1; i <= ABILITY_LIMIT; i++)
            {
                //each skill level
                //ensure the proficiency dice don't outweigh the ability dice
                for (int j = 0; (j <= UPGRADE_LIMIT) && (j <= i); j++)
                {
                    //each difficulty
                    for (int k = 1; k <= DIFFICULTY_LIMIT; k++)
                    {
                        //ensure the proficiency dice don't outweigh the ability dice
                        for (int l = 0; (l <= CHALLENGE_LIMIT) && (l <= k); l++)
                        {
                            for (int m = 0; m < BOOST_LIMIT; m++)
                            {
                                for (int n = 0; n < SETBACK_LIMIT; n++)
                                {
                                    List <Die>          pool       = GetPool(i - j, j, k - l, l, m, n);
                                    BreakdownCalculator calculator = new BreakdownCalculator(pool);
                                    resultList.Add(calculator.Run());
                                }
                            }
                        }
                    }
                }
            }

            writer.WriteLine("pool,total,unique,successes,%,failures,%,advantages,%,threats,%,stalemate,%,triumphs,%,despairs,%");
            writer.WriteLine(string.Format("{0}", string.Join("\n", resultList)));
            writer.WriteLine();

            writer.Close();
        }