< Dice‎ | RollerConfig
Revision as of 18:22, 10 April 2017 by Skizzerz (talk | contribs) (Created page with "{{APIdoc|RollerConfig.MaxRecursionDepth Property}} Gets or sets how deeply nested a dice expression can get. {{ns}} == Syntax == <syntaxhighlight lang="C#"> public ushort Ma...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

RollerConfig.MaxRecursionDepth Property

From DiceRoller Documentation

Gets or sets how deeply nested a dice expression can get.

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

Syntax

public ushort MaxRecursionDepth { get; set; }

Property Value

Type: System.UInt16

The maximum amount of nesting that can happen in dice expressions. Exceeding this limit will result in a DiceException being thrown with DiceErrorCode.RecursionDepthExceeded.

Remarks

The default value for MaxRecursionDepth is 20. It is recommended to not set this too high, but it should be high enough to handle complex rolls. For example, the dice expression floor((1d20rr<5dl1 + 2) * 1.5) has a depth of 5 (floor is at the top, then multiply, add, drop, reroll, roll). The topmost operation counts as depth 0 rather than depth 1 for the purposes of MaxRecusionDepth.