< Dice | FunctionContext
Difference between revisions of "Dice/FunctionContext/FunctionContext"
From DiceRoller Documentation
(Created page with "{{APIdoc|FunctionContext Constructor (FunctionScope, String, IReadOnlyList<DiceAST>)}} Constructs a new instance of FunctionContext. {{ns}} == Syntax == <syntaxhighlight lan...") |
|||
Line 41: | Line 41: | ||
== Remarks == | == Remarks == | ||
− | Value is initialized to Decimal.MinValue 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 | + | [[../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 19:22, 25 April 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.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | name is null
-or- arguments is |
ArgumentException | arguments contains null values in the 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.