Pathfinder IsMoving, Stop

This commit is contained in:
2012-10-03 11:17:01 +02:00
parent 8a75c98f48
commit 2d554faeb3
@@ -43,6 +43,14 @@ namespace DepthsBelow.Component
} }
} }
public bool IsMoving
{
get
{
return path != null && path.Count() != 0;
}
}
private AStar.PathFinderFast pathFinder; private AStar.PathFinderFast pathFinder;
private List<AStar.PathFinderNode> path; private List<AStar.PathFinderNode> path;
@@ -79,6 +87,11 @@ namespace DepthsBelow.Component
return (Node)nextNode; return (Node)nextNode;
} }
public void Stop()
{
path = null;
}
private List<AStar.PathFinderNode> FindPath(Point start, Point goal, List<Point> appendCollisionMap) private List<AStar.PathFinderNode> FindPath(Point start, Point goal, List<Point> appendCollisionMap)
{ {
byte[,] mapCollisionMap = Core.Map.GetCollisionMap(); byte[,] mapCollisionMap = Core.Map.GetCollisionMap();