C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
Tokenize List

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
Tokenize ( string equationText ) : List

Tokenize the specified equationText.

Описание методов

AddFunction() публичный Метод

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
Результат void

Equation() публичный Метод

Initializes a new instance of the Equationator.Equation class.
public Equation ( ) : System
Результат System

Parse() публичный Метод

Parse the specified equationText.
public Parse ( string equationText ) : void
equationText string Equation text.
Результат void

Solve() публичный Метод

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
Результат float