C# Class Danmaku_no_Kyojin.BulletEngine.Equationator.BaseNode

This is a single node of the equation. All the other node types inherit from this one.
Mostrar archivo Open project: Noxalus/Danmaku-no-Kyojin Class Usage Examples

Public Methods

Method Description
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.

Protected Methods

Method Description
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

Private Methods

Method Description
GetHighestPemdas ( ) : BaseNode

Gets the highest pemdas.

Method Details

AppendNextNode() public method

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

BaseNode() public method

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

GetHead() public method

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

MakeHead() protected method

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

MakeTail() protected method

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

Parse() public static method

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
return BaseNode

ParseOperNode() protected static method

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
return BaseNode

ParseToken() protected abstract method

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
return void

ParseValueNode() protected static method

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
return BaseNode

Solve() public abstract method

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.
return float

Treeify() public method

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
return BaseNode