public static BonusType Convert(BetBonusType type) { if (type != BetBonusType.Total) { throw new InvalidEnumArgumentException($"Invalid BetBonusType value: {type}."); } return(BonusType.Total); }
public BetBonus(long value, BetBonusType type, BetBonusMode mode) { Guard.Argument(value, nameof(value)).InRange(1, 1000000000000000000 - 1); Value = value; Type = type; Mode = mode; }
/// <summary> /// Sets the <see cref="IBetBonus" /> /// </summary> /// <param name="value">The quantity multiplied by 10000 and rounded to a long value</param> /// <param name="betBonusMode">The bet bonus mode</param> /// <param name="betBonusType">Type of the bet bonus</param> /// <returns>Returns a <see cref="IBetBuilder" /></returns> public IBetBuilder SetBetBonus(long value, BetBonusMode betBonusMode = BetBonusMode.All, BetBonusType betBonusType = BetBonusType.Total) { if (!(value > 0 && value < 1000000000000000000)) { throw new ArgumentException("BetBonus value not valid. Must be greater then zero."); } _betBonus = new BetBonus(value, betBonusType, betBonusMode); return(this); }