/// <summary> /// Processes a <see cref="PathRequest"/> /// </summary> /// <param name="pathRequest"></param> public void Process(PathRequest <TPath> pathRequest) { if (_pathCache == null || !_pathCache.TryGetValue(pathRequest, out var path)) { path = _algorithm.FindPath(NodeNetwork, pathRequest); _pathCache?.Add(pathRequest, path); } var succes = path != null?_algorithm.ValidatePath(NodeNetwork, pathRequest, path) : false; if (path == null) { path = _algorithm.GetDefaultPath(NodeNetwork, pathRequest); } Debug.WriteLine(succes ? $"{_algorithm.GetType()} has found a path" : $"{_algorithm.GetType()} did not find a path :("); pathRequest.FinishSolvePath(path, succes); }
public PathRequestAwaiter(PathRequest <TPath> pathRequest) { _pathRequest = pathRequest; }
public void RequestPath(PathRequest <TPath> pathRequest) { _multithreadedWorkerQueue.Enqueue(pathRequest); }
public PathRequest <TPath> RequestPath(DefinitionNode start, DefinitionNode end, PathfindaxCollisionCategory collisionLayer = PathfindaxCollisionCategory.None, byte agentSize = 1) { return(PathRequest.Create(this, start, end, collisionLayer, agentSize)); }
/// <summary> /// Processes a <see cref="PathRequest"/> /// </summary> /// <param name="pathRequest"></param> public void Process(PathRequest <TPath> pathRequest) { var path = _algorithm.FindPath(NodeNetwork, pathRequest, out var succes); pathRequest.FinishSolvePath(path, succes); }
public PathRequest <TPath> RequestPath(int start, int end, PathfindaxCollisionCategory collisionLayer = PathfindaxCollisionCategory.None, byte agentSize = 1) { return(PathRequest.Create(this, 0, 0, PathfindaxCollisionCategory.None, 0)); }
public void RequestPath(PathRequest <TPath> pathRequest) { }
public void RequestPath(PathRequest <TPath> pathRequest) { pathRequest.StartSolvePath(this); _multithreadedWorkerQueue.Enqueue(pathRequest); }