C# Класс 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."
Наследование: AStarNode
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
AddSuccessor ( ArrayList aSuccessors, int aX, int aY ) : void

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

Описание методов

AStarNode2D() публичный Метод

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
Результат System

Calculate() публичный Метод

Calculates the estimated cost for the remaining trip to the goal.
public Calculate ( ) : void
Результат void

GetSuccessors() публичный Метод

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
Результат void

IsSameState() публичный Метод

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
Результат bool

PrintNodeInfo() публичный Метод

Prints information about the current node
public PrintNodeInfo ( ) : int[]
Результат int[]