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.
Afficher le fichier Open project: Noxalus/Danmaku-no-Kyojin Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode Description
GetHighestPemdas ( ) : BaseNode

Gets the highest pemdas.

Method Details

AppendNextNode() public méthode

Appends the next node.
public AppendNextNode ( BaseNode nextNode ) : void
nextNode BaseNode Next node.
Résultat void

BaseNode() public méthode

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

GetHead() public méthode

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

MakeHead() protected méthode

Make this node into a head node.
protected MakeHead ( ) : void
Résultat void

MakeTail() protected méthode

Makes this node into a tail node.
protected MakeTail ( ) : void
Résultat void

Parse() public static méthode

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
Résultat BaseNode

ParseOperNode() protected static méthode

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
Résultat BaseNode

ParseToken() protected abstract méthode

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
Résultat void

ParseValueNode() protected static méthode

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
Résultat BaseNode

Solve() public abstract méthode

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.
Résultat float

Treeify() public méthode

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
Résultat BaseNode