C# Class Danmaku_no_Kyojin.BulletEngine.Equationator.Equation

This is the main class of teh Equationator. It contains one entire equation. Usage is to create one of these, add all the delegate methods, parse the equation string, and then call teh Solve function whenever need a result from it. A good idea would be to subclass this and have the child class set up all the delegate methods in it's constructor.
显示文件 Open project: Noxalus/Danmaku-no-Kyojin Class Usage Examples

Private Properties

Property Type Description
Tokenize List

Public Methods

Method Description
AddFunction ( string functionText, FunctionDelegate callbackMethod ) : void

Adds a function to the grammar dictionaary so that it can be used in equations.

Equation ( ) : System

Initializes a new instance of the Equationator.Equation class.

Parse ( string equationText ) : void

Parse the specified equationText.

Solve ( ParamDelegate paramCallback ) : float

Get a result from the equation

Private Methods

Method Description
Tokenize ( string equationText ) : List

Tokenize the specified equationText.

Method Details

AddFunction() public method

Adds a function to the grammar dictionaary so that it can be used in equations.
thrown when the fucntionText is incorrect format
public AddFunction ( string functionText, FunctionDelegate callbackMethod ) : void
functionText string
callbackMethod FunctionDelegate Callback method that will be called when $XXXX is encountered in an equation
return void

Equation() public method

Initializes a new instance of the Equationator.Equation class.
public Equation ( ) : System
return System

Parse() public method

Parse the specified equationText.
public Parse ( string equationText ) : void
equationText string Equation text.
return void

Solve() public method

Get a result from the equation
public Solve ( ParamDelegate paramCallback ) : float
paramCallback ParamDelegate This is a callback function to get the value of params to pass to this equation
return float