Difference between revisions of "Dice/FunctionContext/FunctionContext"

From DiceRoller Documentation
Line 25: Line 25:
 
: Type: System.Collections.Generic.IReadOnlyList<[[Dice/AST/DiceAST|Dice.AST.DiceAST]]>
 
: Type: System.Collections.Generic.IReadOnlyList<[[Dice/AST/DiceAST|Dice.AST.DiceAST]]>
 
: The list of arguments that were passed to the function, may be an empty list.
 
: The list of arguments that were passed to the function, may be an empty list.
 
== Exceptions ==
 
{| class="wikitable"
 
! Exception !! Condition
 
|-
 
| ArgumentNullException
 
| ''name'' is {{cs|null}}
 
 
-or-
 
 
''arguments'' is {{cs|null}}.
 
|-
 
| ArgumentException || ''arguments'' contains {{cs|null}} values in the list.
 
|}
 
  
 
== Remarks ==
 
== Remarks ==
 
[[../Value|Value]] is initialized to Decimal.MinValue, [[../Values|Values]] is initialized to {{cs|null}}, and [[../ValueType|ValueType]] is initialized to ResultType.Total. The function's callback '''must''' modify Value to some other value, and may modify Values and ValueType if the defaults are insufficient. See the documentation for Values and ValueType for more details on how they interact if they are left at their defaults.
 
[[../Value|Value]] is initialized to Decimal.MinValue, [[../Values|Values]] is initialized to {{cs|null}}, and [[../ValueType|ValueType]] is initialized to ResultType.Total. The function's callback '''must''' modify Value to some other value, and may modify Values and ValueType if the defaults are insufficient. See the documentation for Values and ValueType for more details on how they interact if they are left at their defaults.

Revision as of 22:55, 14 August 2017

Constructs a new instance of FunctionContext.

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

Syntax

internal FunctionContext(
    FunctionScope scope,
    string name,
    IReadOnlyList<DiceAST> arguments
)

Parameters

scope
Type: Dice.FunctionScope
Scope that the function was called in.
name
Type: System.String
Name of the function that was called, cased according to how it was registered.
arguments
Type: System.Collections.Generic.IReadOnlyList<Dice.AST.DiceAST>
The list of arguments that were passed to the function, may be an empty list.

Remarks

Value is initialized to Decimal.MinValue, Values is initialized to null, and ValueType is initialized to ResultType.Total. The function's callback must modify Value to some other value, and may modify Values and ValueType if the defaults are insufficient. See the documentation for Values and ValueType for more details on how they interact if they are left at their defaults.