Difference between revisions of "Dice/DieResult"

From DiceRoller Documentation
(update DieResult per recent changes)
Line 21: Line 21:
 
|-
 
|-
 
| {{public}} {{method}} || [[/GetHashCode|GetHashCode()]] || Gets a hash code for the DieResult. Overridden from Object.GetHashCode().
 
| {{public}} {{method}} || [[/GetHashCode|GetHashCode()]] || Gets a hash code for the DieResult. Overridden from Object.GetHashCode().
 +
|-
 +
| {{public}} {{method}} || [[/IsSpecialDie|IsSpecialDie(SpecialDie)]] || Checks if this die is a special die of the specified type.
 
|-
 
|-
 
| {{public}} {{method}} || [[/Success|Success()]] || Return a new DieResult based on the current one flagged as a success.
 
| {{public}} {{method}} || [[/Success|Success()]] || Return a new DieResult based on the current one flagged as a success.

Revision as of 06:23, 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().
IsSpecialDie(SpecialDie) Checks if this die is a special die of the specified type.
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.