Pathfinder IsMoving, Stop

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