Class ModifierFormulaParser
Inheritance
ModifierFormulaParser
Assembly: cs.temp.dll.dll
public class ModifierFormulaParser : IModifierFormulaParser, IInjectable
Fields
Declaration
protected IToken[] _cachedRPNResult
Field Value
Declaration
protected Dictionary<string, IModifierGroupData> _modifierGroupLookup
Field Value
Declaration
protected static Regex BASE
Field Value
Declaration
protected static Regex COMMA
Field Value
Declaration
protected static Regex FUNCTION
Field Value
Declaration
protected static Regex LEFT_PAREN
Field Value
Declaration
protected static Regex OPERATOR
Field Value
Declaration
protected static Regex RIGHT_PAREN
Field Value
Declaration
protected static Regex VALUE
Field Value
Methods
Declaration
protected virtual int GetPrecedence(string op)
Parameters
Type |
Name |
Description |
String |
op |
|
Returns
Return an array of tokens in Reverse Polish Notation using the Shunting-yard Algorithm.
Declaration
protected virtual IToken[] GetRPNResult(string formula)
Parameters
Type |
Name |
Description |
String |
formula |
The formula to process. Must contain spaces between values, parentheses and operators.
|
Returns
Declaration
public void Inject(IResolver resolver)
Parameters
Type |
Name |
Description |
IResolver |
resolver |
|
Declaration
public virtual double Parse(string formula, IModifier[] modifiers, IModifierGroupData[] modifierGroupDatas, double baseAmount, int additionalLevels)
Parameters
Returns
Given an array of tokens will output a final result.
Declaration
protected virtual double ParseRPN(IToken[] tokens, IModifier[] modifiers, double baseAmount, int additionalLevels)
Parameters
Returns
Implements
IInjectable