Difference between revisions of "Dice/DieResult"

From DiceRoller Documentation
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}} || [[/IsLiveDie|IsLiveDie()]] || Checks if the die is not a special die and has not been dropped.
 
|-
 
|-
 
| {{public}} {{method}} || [[/IsSpecialDie|IsSpecialDie(SpecialDie)]] || Checks if this die is a special die of the specified type.
 
| {{public}} {{method}} || [[/IsSpecialDie|IsSpecialDie(SpecialDie)]] || Checks if this die is a special die of the specified type.

Revision as of 06:41, 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().
IsLiveDie() Checks if the die is not a special die and has not been dropped.
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.