< Dice
Revision as of 20:22, 12 April 2017 by Skizzerz (talk | contribs) (Created page with "{{APIdoc|FunctionCallback Delegate}} Encapsulates a method which executes function logic. {{ns}} == Syntax == <syntaxhighlight lang="C#"> public delegate void FunctionCallba...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

FunctionCallback Delegate

From DiceRoller Documentation

Encapsulates a method which executes function logic.

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

Syntax

public delegate void FunctionCallback(
    FunctionContext context
)

Parameters

context
Type: Dice.FunctionContext
Function context, to be filled in by the delegate.

Remarks

The FunctionCallback delegate is used alongside the DiceFunctionAttribute and FunctionRegistry.RegisterType, or with FunctionRegistry.RegisterFunction. The delegate can gain insight into the context of the function call by examining the passed-in context object, and it must also modify the context object's Value and Values. If no delegate in the chain modifies the context's Value or Values, an exception is thrown.