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.
파일 보기 프로젝트 열기: Noxalus/Danmaku-no-Kyojin 1 사용 예제들

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