< Dice | RollResult
Difference between revisions of "Dice/RollResult/ToString"
From DiceRoller Documentation
(Created page with "{{APIdoc|RollResult.ToString Method ()}} Display a representation of the roll. Overridden from Object.ToString(). {{ns}} == Syntax == <syntaxhighlight lang="C#"> public over...") |
|||
Line 1: | Line 1: | ||
{{APIdoc|RollResult.ToString Method ()}} | {{APIdoc|RollResult.ToString Method ()}} | ||
− | Display a representation of the roll. | + | Display a representation of the roll. Overrides Object.ToString(). |
{{ns}} | {{ns}} |
Latest revision as of 03:28, 14 April 2017
Display a representation of the roll. Overrides Object.ToString().
- Namespace: Dice
- Assembly: DiceRoller (in DiceRoller.dll)
Syntax
public override string ToString()
Return Value
Type: System.String
The representation of the roll.
Remarks
The representation is displayed as "dice expression => die results => total". Dice expression is the normalized expression (generated via RollResult.RollRoot.ToString()). Die results displays the value rolled for each die, possibly marked with various flags. The total is the total of the roll or the number of successes.
Die results may be marked with any of the following flags:
- A "+" before the die value indicates the die was a success.
- A "~" before the die value indicates the die was a failure (negative success).
- A "*" after the die value indicates the die was dropped.
- A "!" after the die value indicates the die was a critical and/or fumble.
For example, in the expression "(2d20 + 2) * 1.5", assuming 8 and 20 were rolled, the following will display: "(2d20 + 2) * 1.5 => (8 + 20! + 2) * 1.5 => 45".