RollerConfig.MaxRerolls Property

From DiceRoller Documentation

Gets or sets the maximum number of times a single die may be rerolled.

  • Namespace: Dice
  • Assembly: DiceRoller (in DiceRoller.dll)

Syntax

public int MaxRerolls { get; set; }

Property Value

Type: System.Int32

The maximum amount of times a die can be rerolled, either due to rerolls, exploding dice, or anything else that rerolls dice. Once a die is rerolled this many times, the final value is fixed (no exception is thrown).

Remarks

The default value for MaxRerolls is 100. This is a per-die limit, and exceeding this limit results in the final result being fixed rather than an exception being thrown. The intent of this property is to allow rerolls to settle even due to strings of bad luck, but to block an expression that would cause an infinite reroll loop such as 1d6rr>=1 from breaking everything. Every time a die is rerolled, it counts as a new roll for the purposes of RollerConfig.MaxDice.