C# 클래스 Danmaku_no_Kyojin.BulletEngine.Equationator.BaseNode

This is a single node of the equation. All the other node types inherit from this one.
파일 보기 프로젝트 열기: Noxalus/Danmaku-no-Kyojin 1 사용 예제들

공개 메소드들

메소드 설명
AppendNextNode ( BaseNode nextNode ) : void

Appends the next node.

BaseNode ( ) : System

Initializes a new instance of the Equationator.EquationNode class.

GetHead ( ) : BaseNode

Add the ability for any node in a list to get the head node of the list.

Parse ( List tokenList, int &curIndex, Equation owner ) : BaseNode

Parse a list of tokens into a linked list of equation nodes. This will sort it out into a flat equation

Solve ( ParamDelegate paramCallback ) : float

Solve the equation! This method recurses into the whole tree and returns a result from the equation.

Treeify ( ) : BaseNode

This method takes a node from a linked list, and folds it into a binary tree. The root node will have the highest pemdas value and the tree will be solved breadth first, ensuring that the root node is solved last.

보호된 메소드들

메소드 설명
MakeHead ( ) : void

Make this node into a head node.

MakeTail ( ) : void

Makes this node into a tail node.

ParseOperNode ( List tokenList, int &curIndex, Equation owner ) : BaseNode

Given a list of tokens and the index, get an operator node based on whatever is at that index.

ParseToken ( List tokenList, int &curIndex, Equation owner ) : void

Parse the specified tokenList and curIndex. overloaded by child types to do there own specific parsing.

ParseValueNode ( List tokenList, int &curIndex, Equation owner ) : BaseNode

Given a list of tokens and the index, get a node based on whatever is at that index

비공개 메소드들

메소드 설명
GetHighestPemdas ( ) : BaseNode

Gets the highest pemdas.

메소드 상세

AppendNextNode() 공개 메소드

Appends the next node.
public AppendNextNode ( BaseNode nextNode ) : void
nextNode BaseNode Next node.
리턴 void

BaseNode() 공개 메소드

Initializes a new instance of the Equationator.EquationNode class.
public BaseNode ( ) : System
리턴 System

GetHead() 공개 메소드

Add the ability for any node in a list to get the head node of the list.
public GetHead ( ) : BaseNode
리턴 BaseNode

MakeHead() 보호된 메소드

Make this node into a head node.
protected MakeHead ( ) : void
리턴 void

MakeTail() 보호된 메소드

Makes this node into a tail node.
protected MakeTail ( ) : void
리턴 void

Parse() 공개 정적인 메소드

Parse a list of tokens into a linked list of equation nodes. This will sort it out into a flat equation
public static Parse ( List tokenList, int &curIndex, Equation owner ) : BaseNode
tokenList List Token list.
curIndex int Current index. When this function exits, will be incremented to the past any tokens consumed by this method
owner Equation the equation that this node is part of. required to pull function delegates out of the dictionary
리턴 BaseNode

ParseOperNode() 보호된 정적인 메소드

Given a list of tokens and the index, get an operator node based on whatever is at that index.
protected static ParseOperNode ( List tokenList, int &curIndex, Equation owner ) : BaseNode
tokenList List Token list.
curIndex int Current index.
owner Equation the equation that this node is part of. required to pull function delegates out of the dictionary
리턴 BaseNode

ParseToken() 보호된 추상적인 메소드

Parse the specified tokenList and curIndex. overloaded by child types to do there own specific parsing.
protected abstract ParseToken ( List tokenList, int &curIndex, Equation owner ) : void
tokenList List Token list.
curIndex int Current index.
owner Equation the equation that this node is part of. required to pull function delegates out of the dictionary
리턴 void

ParseValueNode() 보호된 정적인 메소드

Given a list of tokens and the index, get a node based on whatever is at that index
protected static ParseValueNode ( List tokenList, int &curIndex, Equation owner ) : BaseNode
tokenList List Token list.
curIndex int Current index.
owner Equation the equation that this node is part of. required to pull function delegates out of the dictionary
리턴 BaseNode

Solve() 공개 추상적인 메소드

Solve the equation! This method recurses into the whole tree and returns a result from the equation.
public abstract Solve ( ParamDelegate paramCallback ) : float
paramCallback ParamDelegate Parameter callback that will be used to get teh values of parameter nodes.
리턴 float

Treeify() 공개 메소드

This method takes a node from a linked list, and folds it into a binary tree. The root node will have the highest pemdas value and the tree will be solved breadth first, ensuring that the root node is solved last.
public Treeify ( ) : BaseNode
리턴 BaseNode