< Dice
Difference between revisions of "Dice/DieResult"
From DiceRoller Documentation
(Created page with "{{APIdoc|DieResult Structure}} Contains the result of an individual die roll. {{ns}} == Syntax == <syntaxhighlight lang="C#"> public struct DieResult </syntaxhighlight> ==...") |
(update DieResult per recent changes) |
||
| Line 9: | Line 9: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | == | + | == Methods == |
{| class="wikitable" | {| class="wikitable" | ||
! style="width: 5em" | | ! style="width: 5em" | | ||
! Name !! Description | ! Name !! Description | ||
|- | |- | ||
| − | | {{public}} {{ | + | | {{public}} {{method}} || [[/Drop|Drop()]] || Return a new DieResult based on the current one flagged as dropped. |
|- | |- | ||
| − | | {{public}} {{ | + | | {{public}} {{method}} || [[/Equals|Equals(object)]] || Compare two DieResults and return whether or not they are equal. Overridden from Object.Equals(object). |
|- | |- | ||
| − | | {{public}} {{ | + | | {{public}} {{method}} || [[/Failure|Failure()]] || Return a new DieResult based on the current one flagged as a failure. |
|- | |- | ||
| − | | {{public}} {{ | + | | {{public}} {{method}} || [[/GetHashCode|GetHashCode()]] || Gets a hash code for the DieResult. Overridden from Object.GetHashCode(). |
| + | |- | ||
| + | | {{public}} {{method}} || [[/Success|Success()]] || Return a new DieResult based on the current one flagged as a success. | ||
| + | |} | ||
| + | |||
| + | == Properties == | ||
| + | {| class="wikitable" | ||
| + | ! style="width: 5em" | | ||
| + | ! Name !! Description | ||
| + | |- | ||
| + | | {{public}} {{property}} || [[/DieType|DieType]] || What type of die was rolled. | ||
| + | |- | ||
| + | | {{public}} {{property}} || [[/Flags|Flags]] || Any special flags giving more information about the roll. | ||
| + | |- | ||
| + | | {{public}} {{property}} || [[/NumSides|NumSides]] || How many sides the die had. | ||
| + | |- | ||
| + | | {{public}} {{property}} || [[/Value|Value]] || What the result of the roll was. | ||
| + | |} | ||
| + | |||
| + | == Overloaded Operators == | ||
| + | {| class="wikitable" | ||
| + | ! style="width: 5em" | | ||
| + | ! Name !! Description | ||
| + | |- | ||
| + | | {{public}} {{static}} {{method}} || [[/operator ==|operator ==(DieResult, DieResult)]] || Implements DieResult == DieResult. | ||
| + | |- | ||
| + | | {{public}} {{static}} {{method}} || [[/operator !=|operator !=(DieResult, DieResult)]] || Implements DieResult != DieResult. | ||
|} | |} | ||
== Remarks == | == Remarks == | ||
| − | The NumSides | + | The NumSides property is only non-zero if DieType is {{cs|DieType.Normal}} or {{cs|DieType.Fudge}}. If DieType is {{cs|DieType.Special}}, then Value can be cast into a [[Dice/SpecialDie|SpecialDie enum]] value. |
Revision as of 05:46, 15 April 2017
Contains the result of an individual die roll.
- Namespace: Dice
- Assembly: DiceRoller (in DiceRoller.dll)
Syntax
public struct DieResult
Methods
| Name | Description | |
|---|---|---|
| Drop() | Return a new DieResult based on the current one flagged as dropped. | |
| Equals(object) | Compare two DieResults and return whether or not they are equal. Overridden from Object.Equals(object). | |
| Failure() | Return a new DieResult based on the current one flagged as a failure. | |
| GetHashCode() | Gets a hash code for the DieResult. Overridden from Object.GetHashCode(). | |
| Success() | Return a new DieResult based on the current one flagged as a success. |
Properties
| Name | Description | |
|---|---|---|
| DieType | What type of die was rolled. | |
| Flags | Any special flags giving more information about the roll. | |
| NumSides | How many sides the die had. | |
| Value | What the result of the roll was. |
Overloaded Operators
| Name | Description | |
|---|---|---|
| S | operator ==(DieResult, DieResult) | Implements DieResult == DieResult. |
| S | operator !=(DieResult, DieResult) | Implements DieResult != DieResult. |
Remarks
The NumSides property is only non-zero if DieType is DieType.Normal or DieType.Fudge. If DieType is DieType.Special, then Value can be cast into a SpecialDie enum value.