Difference between revisions of "Dice/DieResult"

From DiceRoller Documentation
Line 34: Line 34:
 
! Name !! Description
 
! Name !! Description
 
|-
 
|-
| {{public}} {{property}} || [[/DieType|DieType]] || What type of die was rolled.
+
| {{public}} {{property}} || [[/DieType|DieType]] || Gets or sets what type of die was rolled.
 
|-
 
|-
| {{public}} {{property}} || [[/Flags|Flags]] || Any special flags giving more information about the roll.
+
| {{public}} {{property}} || [[/Flags|Flags]] || Gets or sets any special flags giving more information about the roll.
 
|-
 
|-
| {{public}} {{property}} || [[/NumSides|NumSides]] || How many sides the die had.
+
| {{public}} {{property}} || [[/NumSides|NumSides]] || Gets or sets how many sides the die had.
 
|-
 
|-
| {{public}} {{property}} || [[/Value|Value]] || What the result of the roll was.
+
| {{public}} {{property}} || [[/SpecialDie|SpecialDie]] || Gets or sets what type of special die this is. Calling this is an error if DieType != DieType.SpecialDie.
 +
|-
 +
| {{public}} {{property}} || [[/SuccessCount|SuccessCount]] || Gets 1 if the die is a success, -1 if the die is a failure, and 0 otherwise.
 +
|-
 +
| {{public}} {{property}} || [[/Value|Value]] || Gets or sets what the result of the roll was.
 
|}
 
|}
  

Revision as of 06:54, 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 Gets or sets what type of die was rolled.
Flags Gets or sets any special flags giving more information about the roll.
NumSides Gets or sets how many sides the die had.
SpecialDie Gets or sets what type of special die this is. Calling this is an error if DieType != DieType.SpecialDie.
SuccessCount Gets 1 if the die is a success, -1 if the die is a failure, and 0 otherwise.
Value Gets or sets 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.