Difference between revisions of "Dice/MacroContext/MacroContext"

From DiceRoller Documentation
Line 7: Line 7:
 
<syntaxhighlight lang="C#">
 
<syntaxhighlight lang="C#">
 
internal MacroContext(
 
internal MacroContext(
     string param
+
     string param,
 +
    RollData data
 
)
 
)
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 15: Line 16:
 
: Type: System.String
 
: Type: System.String
 
: The macro's text.
 
: The macro's text.
 +
 +
; ''data''
 +
: Type: {{l|Dice.RollData}}
 +
: Data for the dice roll.
  
 
== 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 23:11, 14 August 2017

Constructs a new instance of MacroContext.

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

Syntax

internal MacroContext(
    string param,
    RollData data
)

Parameters

param
Type: System.String
The macro's text.
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.