Esempio n. 1
0
        public static int Roll(DiceShape shape, int noOfDice)
        {
            int result = 0;

            for (int diceRolled = 0; diceRolled < noOfDice; diceRolled++)
            {
                result += Roll(shape);
            }

            return(result);
        }
Esempio n. 2
0
        public static int RollAtLeast(DiceShape shape, int target, int noOfDice)
        {
            var result = 0;

            for (int diceRolled = 0; diceRolled < noOfDice; diceRolled++)
            {
                if (Roll(shape) >= target)
                {
                    result++;
                }
            }

            return(result);
        }
 public DamageExpression(int noOfDice, DiceShape dice, int constantDamage)
 {
     NoOfDice       = noOfDice;
     Dice           = dice;
     ConstantDamage = constantDamage;
 }
 public DamageExpression(int noOfDice, DiceShape dice)
 {
     NoOfDice = noOfDice;
     Dice     = dice;
 }
Esempio n. 5
0
 public static int Roll(DiceShape shape)
 {
     return(_random.Next(1, (int)shape + 1));
 }