public void RequestPathToItem(ItemType itemType) { var sourceNodeIndex = _owner.World.graph.FindNearestNode(_owner.VPos).Index; _search = new DijkstraSearch(graph: _owner.World.graph, source: sourceNodeIndex, type: itemType); _owner.FindPathResult = PathResult.InProgress; _owner.World.PathManager.Register(this); }
public void RequestPathToTarget(Vector2D target) { var sourceNodeIndex = _owner.World.graph.FindNearestNode(_owner.VPos).Index; var targetNodeIndex = _owner.World.graph.FindNearestNode(target).Index; _search = new AStarSearch(graph: _owner.World.graph, source: sourceNodeIndex, target: targetNodeIndex); _owner.FindPathResult = PathResult.InProgress; _owner.World.PathManager.Register(this); }