Internal_rootA reference to the Roll at the root of the evaluation tree.
Is this term intermediate, and should be evaluated first as part of the simplification process?
The term's operator value.
An object of additional options which describes and modifies the term.
StaticFLAVOR_A regular expression which identifies term-level flavor text
StaticFLAVOR_A regular expression pattern which identifies optional term-level flavor text
StaticOPERATORSAn array of operators which represent arithmetic operations
StaticPRECEDENCEAn object of operators with their precedence values.
StaticREGEXPStaticSERIALIZE_A string representation of the formula, including optional flavor text.
Whether this term is entirely deterministic or contains some randomness.
A reference to the RollResolver app being used to externally resolve this term.
Evaluate the term, processing its inputs and finalizing its total.
Optionaloptions: { allowStrings?: boolean; maximize?: boolean; minimize?: boolean } = {}Options which modify how the RollTerm is evaluated
OptionalallowStrings?: booleanIf true, string terms will not throw an error when evaluated.
Optionalmaximize?: booleanMaximize the result, obtaining the largest possible value.
Optionalminimize?: booleanMinimize the result, obtaining the smallest possible value.
Returns a Promise if the term is non-deterministic.
Serialize the RollTerm to a JSON string which allows it to be saved in the database or embedded in text. This method should return an object suitable for passing to the JSON.stringify function.
Protected_evaluateStatic_fromStaticfromConstruct a RollTerm from a provided data object
Provided data from an un-serialized term
The constructed RollTerm
StaticfromJSONReconstruct a RollTerm instance from a provided JSON string
A serialized JSON representation of a DiceTerm
A reconstructed RollTerm from the provided JSON
StaticfromConstruct a RollTerm from parser information.
The node.
StaticisDetermine if evaluating a given RollTerm with certain evaluation options can be done so deterministically.
The term.
Optionaloptions: { maximize?: boolean; minimize?: boolean } = {}Options for evaluating the term.
Optionalmaximize?: booleanForce the result to be maximized.
Optionalminimize?: booleanForce the result to be minimized.
A type of RollTerm used to denote and perform an arithmetic operation.