Пример #1
0
        public DiceRoll RerollMany(DiceRoll diceRoll, int[] indexes)
        {
            if (!indexes.Length.Between(1, 5))
            {
                throw new System.IndexOutOfRangeException($@"Too {(indexes.Length > 5 ? "many" : "few")} dice to reroll.");
            }
            if (indexes.Length == 5)
            {
                return(Roll());
            }
            var current = diceRoll.AllDice;

            foreach (var dice in indexes)
            {
                current[dice] = DiceHelper.GetRoll();
            }
            return(new DiceRoll(current));
        }
Пример #2
0
 private DieRoll GetRoll()
 {
     return(DiceHelper.GetRoll());
 }