public static int Roll(DiceShape shape, int noOfDice) { int result = 0; for (int diceRolled = 0; diceRolled < noOfDice; diceRolled++) { result += Roll(shape); } return(result); }
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; }
public static int Roll(DiceShape shape) { return(_random.Next(1, (int)shape + 1)); }