< Dice‎ | FunctionContext
Revision as of 23:11, 14 August 2017 by Skizzerz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

FunctionContext Constructor (FunctionScope, String, IReadOnlyList<DiceAST>, RollData)

From DiceRoller Documentation

Constructs a new instance of FunctionContext.

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

Syntax

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

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.
data
Type: Dice.RollData
Data for the dice roll.

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.