/// <summary> /// Roll a number of the specified type of dice. /// </summary> /// <param name="type">Type.</param> /// <param name="count">numbre of dice to throw.</param> /// <returns>The Sum of all dice thrown</returns> public static int Roll(Dice.Type type, int count) { int total = 0; for (int i = 0; i < count; i++) { total += rand.Next((int)type) + 1; } return(total); }
/// <summary> /// Roll a number of the specified type of dice. /// </summary> /// <param name="type">Type.</param> /// <param name="count">numbre of dice to throw.</param> /// <returns>The Sum of all dice thrown</returns> public static int Roll(Dice.Type type, int count = 1, int modifier = 0) { int total = 0; for (int i = 0; i < count; i++) { total += GodPlaysDice.Next((int)type) + 1; // +1 because Dice don't have a zero. } return(total + modifier); }
public int this[Dice.Type t] { get { return(diceNum[(int)t]); } set { diceNum[(int)t] = value; NotifyPropertyChanged("Item[]"); NotifyPropertyChanged("Name"); } }
public void Add(Dice.Type t, int ammount = 1) { this[t] += ammount; }