C# Class Universe.BotManager.AStar.AStarNode2D

A node class for doing path finding on a 2-dimensional map Christy Lock Note: Astar.cs, Heap.cs and Main.cs were originally written by Sune Trundslev 4 Jan 2004 I has made small modifications to Astar.cs and Main.cs to handle the 3d Metaverse Specifically to return waypoints in generic string Lists broken into slope changes. These are returned to BotMe.cs. You can find the original code at http://www.codeproject.com/KB/recipes/csharppathfind.aspx Note that there is no specific license in the code download and the author states " With this class, you should be able to implement your own A* path finding to your own c# projects."
Inheritance: AStarNode
Exibir arquivo Open project: Virtual-Universe/Virtual-Universe Class Usage Examples

Public Methods

Method Description
AStarNode2D ( AStarNode aParent, AStarNode aGoalNode, double aCost, int aX, int aY ) : System

Constructor for a node in a 2-dimensional map

Calculate ( ) : void

Calculates the estimated cost for the remaining trip to the goal.

GetSuccessors ( ArrayList aSuccessors ) : void

Gets all successors nodes from the current node and adds them to the successor list

IsSameState ( AStarNode aNode ) : bool

Determines whether the current node is the same state as the on passed.

PrintNodeInfo ( ) : int[]

Prints information about the current node

Private Methods

Method Description
AddSuccessor ( ArrayList aSuccessors, int aX, int aY ) : void

Adds a successor to a list if it is not impassible or the parent node

Method Details

AStarNode2D() public method

Constructor for a node in a 2-dimensional map
public AStarNode2D ( AStarNode aParent, AStarNode aGoalNode, double aCost, int aX, int aY ) : System
aParent AStarNode Parent of the node
aGoalNode AStarNode Goal node
aCost double Accumulative cost
aX int X-coordinate
aY int Y-coordinate
return System

Calculate() public method

Calculates the estimated cost for the remaining trip to the goal.
public Calculate ( ) : void
return void

GetSuccessors() public method

Gets all successors nodes from the current node and adds them to the successor list
public GetSuccessors ( ArrayList aSuccessors ) : void
aSuccessors System.Collections.ArrayList List in which the successors will be added
return void

IsSameState() public method

Determines whether the current node is the same state as the on passed.
public IsSameState ( AStarNode aNode ) : bool
aNode AStarNode AStarNode to compare the current node to
return bool

PrintNodeInfo() public method

Prints information about the current node
public PrintNodeInfo ( ) : int[]
return int[]