< Dice‎ | RollResult
Revision as of 22:02, 15 September 2017 by Skizzerz (talk | contribs) (Created page with "{{APIdoc|RollResult.InvalidRoll Field}} This RollResult is used as a placeholder whenever an invalid roll is added to a {{l|Dice.PbP.RollPost|RollPost}}. {{ns}} == Syntax ==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

RollResult.InvalidRoll Field

From DiceRoller Documentation

This RollResult is used as a placeholder whenever an invalid roll is added to a RollPost.

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

Syntax

public static readonly RollResult InvalidRoll

Field Value

Type: Dice.RollResult

The placeholder result indicating an invalid roll.

Remarks

This is a sentinel value used for invalid rolls. You can test if a given roll is invalid by using the {{{1}}} operator. For example, {{{1}}}. Do not attempt to compare using reference equality, as a deserialized RollResult may be an invalid roll but will be a different object (in memory) than RollResult.InvalidRoll. In other words, ensure that both sides of the equality comparison are cast to RollResult before executing the check.