/// <inheritdoc/> /// <exception cref="T:System.ArgumentNullException"><paramref name="option"/> is <see langword="null"/></exception> public bool Contains(IDiceRollOption option) { if (option == null) { throw new ArgumentNullException(nameof(option)); } return(Options.Contains(option)); }
/// <exception cref="ArgumentNullException"></exception> /// <inheritdoc/> /// <exception cref="T:Org.Edgerunner.Dice.Exceptions.OptionConflictException">Dice roll options may not contain two options of the same option type.</exception> public IDiceRollOptions Add(IDiceRollOption option) { if (option == null) { throw new ArgumentNullException(nameof(option)); } if (OptionsKeyed.ContainsKey(option.OptionType)) { throw new OptionConflictException("Dice roll options may not contain two options of the same option type."); } Options.Add(option); OptionsKeyed[option.OptionType] = option; return(this); }