Difference between revisions of "Dice/RollerConfig/MaxRerolls"

From DiceRoller Documentation
(Created page with "{{APIdoc|RollerConfig.MaxRerolls Property}} Gets or sets the maximum number of times a single die may be rerolled. {{ns}} == Syntax == <syntaxhighlight lang="C#"> public uin...")
 
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
 
== Syntax ==
 
== Syntax ==
 
<syntaxhighlight lang="C#">
 
<syntaxhighlight lang="C#">
public uint MaxRerolls { get; set; }
+
public int MaxRerolls { get; set; }
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
=== Property Value ===
 
=== Property Value ===
Type: System.UInt32
+
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).
 
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 ==
 
== 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 {{c|1d6rr>=1}} from breaking everything. Every time a die is rerolled, it counts as a new roll for the purposes of [[Dice/RollerConfig/MaxDice|RollerConfig.MaxDice]].
+
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 {{c|1=1d6rr>=1}} from breaking everything. Every time a die is rerolled, it counts as a new roll for the purposes of [[Dice/RollerConfig/MaxDice|RollerConfig.MaxDice]].

Latest revision as of 18:57, 13 April 2017

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.