/// <summary> /// Initializes a new instance of the <see cref="DiceSet"/> class. /// </summary> /// <param name="dice">The dice to initialize the set with.</param> /// <exception cref="T:System.ArgumentNullException"><paramref name="dice"/> is <see langword="null"/></exception> public DiceSet([NotNull] IEnumerable <IDie> dice) { if (dice is null) { throw new ArgumentNullException(nameof(dice)); } var enumerable = dice as IDie[] ?? dice.ToArray(); CheckForMismatch(enumerable); _Storage = new List <IDie>(enumerable); RollOptions = new DiceRollOptions(); }
/// <summary> /// Initializes a new instance of the <see cref="DiceSet"/> class. /// </summary> public DiceSet() { _Storage = new List <IDie>(); RollOptions = new DiceRollOptions(); }