Esempio n. 1
0
        public int Roll(DieRoll dieRoll)
        {
            int total = Roll(dieRoll.DieMax, dieRoll.NumberOfRolls);

            return(total);
            //I need max2 for _rand.Next(max2) >>> _rand.Next(dieRoll.DieMax)
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var roller = new DiceRoller();

            var craps = new DieRoll(6, 2);

            Console.WriteLine(roller.Roll(craps));

            var attack = new List <DieRoll>();

            attack.Add(new DieRoll(20, 1));
            attack.Add(new DieRoll(4, 1));
            attack.Add(new DieRoll(8, 1));

            var attackResult = roller.Roll(attack) + 11;

            Console.WriteLine("Your attack is: " + attackResult);
            Console.WriteLine("Press enter to continue");
            Console.ReadLine();
        }