< Dice
Revision as of 23:26, 11 April 2017 by Skizzerz (talk | contribs) (Created page with "{{APIdoc|DieFlags Enumeration}} Metadata attached to a DieResult. {{ns}} == Syntax == <syntaxhighlight lang="C#"> [Flags] public enum DieFlags </syntaxhig...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

DieFlags Enumeration

From DiceRoller Documentation

Metadata attached to a DieResult.

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

Syntax

[Flags]
public enum DieFlags

Members

Member name Description
Critical Indicates the die was a critical, meant for display purposes.
Fumble Indicates the die was a fumble, meant for display purposes.
Success Indicates the die counted as a success.
Failure Indicates the die counted as a failure.
Dropped Indicates the die result was not kept (dropped).
Extra Indicates the die was added due to an explosion or reroll, and was not one of the original dice rolled.

Remarks

This metadata is not used internally, but may be useful to expose to the end user by changing how die results are displayed appropriately. A die can be both a Critical and a Fumble at the same time, depending on the value of the critical/fumble extras. A die cannot be a success and failure at the same time. If no critical/fumble extras are specified, a die is considered a critical if it rolls its maximum result and a fumble if it rolls its minimum result.

When implementing custom functions, it is worthwhile to check for the Dropped flag so that dropped dice can be handled appropriately. For example, implementing a custom sum() function should probably not add the values of dropped dice.