From 2d554faeb3e7c420d1d50ee33599833601c0ee6f Mon Sep 17 00:00:00 2001 From: Simon Holmberg Date: Wed, 3 Oct 2012 11:17:01 +0200 Subject: [PATCH] Pathfinder IsMoving, Stop --- DepthsBelow/DepthsBelow/Component/PathFinder.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/DepthsBelow/DepthsBelow/Component/PathFinder.cs b/DepthsBelow/DepthsBelow/Component/PathFinder.cs index 4dad9d7..42309c0 100755 --- a/DepthsBelow/DepthsBelow/Component/PathFinder.cs +++ b/DepthsBelow/DepthsBelow/Component/PathFinder.cs @@ -42,6 +42,14 @@ namespace DepthsBelow.Component this.FindPath(this.Parent.GetComponent().Grid.Position, value, null); } } + + public bool IsMoving + { + get + { + return path != null && path.Count() != 0; + } + } private AStar.PathFinderFast pathFinder; private List path; @@ -79,6 +87,11 @@ namespace DepthsBelow.Component return (Node)nextNode; } + public void Stop() + { + path = null; + } + private List FindPath(Point start, Point goal, List appendCollisionMap) { byte[,] mapCollisionMap = Core.Map.GetCollisionMap();