Difference between revisions of "Dice/RollResult/RollResult (RollerConfig, DiceAST, Int32)"

From DiceRoller Documentation
(Created page with "{{APIdoc|RollResult Constructor (ResultType, decimal, IReadOnlyList<DieResult>, DiceAST)}} Constructs a new instance of RollResult. {{ns}} == Syntax == <syntaxhighlight lang...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{APIdoc|RollResult Constructor (ResultType, decimal, IReadOnlyList<DieResult>, DiceAST)}}
+
{{APIdoc|RollResult Constructor (RollerConfig, DiceAST, Int32)}}
 
Constructs a new instance of RollResult.
 
Constructs a new instance of RollResult.
  
Line 7: Line 7:
 
<syntaxhighlight lang="C#">
 
<syntaxhighlight lang="C#">
 
internal RollResult(
 
internal RollResult(
     ResultType resultType,
+
     RollerConfig conf,
     decimal value,
+
     DiceAST rollRoot,
     IReadOnlyList<DieResult> values,
+
     int numRolls
    DiceAST rollRoot
 
 
)
 
)
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
=== Parameters ===
 
=== Parameters ===
; ''resultType''
+
; ''conf''
: Type: [[Dice/ResultType|Dice.ResultType]]
+
: Type: [[Dice/RollerConfig|Dice.RollerConfig]]
: The type of this RollResult.
+
: The configuration used to generate the AST.
 
 
; ''value''
 
: Type: System.Decimal
 
: The overall value of the roll.
 
 
 
; ''values''
 
: Type: System.Collections.Generic.IReadOnlyList<[[Dice/DieResult|Dice.DieResult]]>
 
: The individual results of each die rolled.
 
  
 
; ''rollRoot''
 
; ''rollRoot''
 
: Type: [[Dice/AST/DiceAST|Dice.AST.DiceAST]]
 
: Type: [[Dice/AST/DiceAST|Dice.AST.DiceAST]]
 
: The root of the dice expression's AST.
 
: The root of the dice expression's AST.
 +
 +
; ''numRolls''
 +
: Type: System.Int32
 +
: The number of dice rolls that were needed to fully evaluate this expression.
  
 
== Exceptions ==
 
== Exceptions ==
Line 35: Line 30:
 
! Exception !! Condition
 
! Exception !! Condition
 
|-
 
|-
| ArgumentNullException || ''values'' or ''rollRoot'' is {{cs|null}}.
+
| ArgumentNullException || ''config'' or ''rollRoot'' is {{cs|null}}.
 
|}
 
|}
 +
 +
== Remarks ==
 +
The RollResult's [[../Value|Value]], [[../Values|Values]], [[../ResultType|ResultType]], and [[../Expression|Expression]] are initialized from the corresponding properties on RollRoot, whereas [[../NumRolls|NumRolls]] is initialized via ''numRolls''.

Latest revision as of 18:56, 18 April 2017

Constructs a new instance of RollResult.

  • Namespace: Dice
  • Assembly: DiceRoller (in DiceRoller.dll)

Syntax

internal RollResult(
    RollerConfig conf,
    DiceAST rollRoot,
    int numRolls
)

Parameters

conf
Type: Dice.RollerConfig
The configuration used to generate the AST.
rollRoot
Type: Dice.AST.DiceAST
The root of the dice expression's AST.
numRolls
Type: System.Int32
The number of dice rolls that were needed to fully evaluate this expression.

Exceptions

Exception Condition
ArgumentNullException config or rollRoot is null.

Remarks

The RollResult's Value, Values, ResultType, and Expression are initialized from the corresponding properties on RollRoot, whereas NumRolls is initialized via numRolls.