public void SubmitFindPath(PathRequest _PR, PathFinderManager _PFM, NodeManager _NM) { CurrentStatus = PathfinderStatus.Active; //Debug.Log("PF: Request Recived by Pathfinder!"); CurrentPR = _PR; PFM = _PFM; if (CurrentPR == null) { //Debug.Log("PF: Incompleate Request, Null PR!"); CurrentStatus = PathfinderStatus.Incative; return; } if (CurrentPR.PathIsFound == true) { //Debug.Log("PF: Path Request has already been solved!!"); _PFM.CompleatedRequests.Enqueue(CurrentPR); CurrentStatus = PathfinderStatus.Incative; return; } if (CurrentPR.StartingNode == null || CurrentPR.TargetNode == null || CurrentPR.Requestee == null) { //Debug.Log("PF: Incompleate Request, Null Node/Requetee!"); CurrentStatus = PathfinderStatus.Incative; return; } else if (CurrentPR.IsBeingProcessed == false && CurrentPR.CompletedPath == null) { CurrentNM = _NM; CurrentPR.IsBeingProcessed = true; CallFindPath(); } }
// void ResetPathFinder() { CurrentPR = null; CurrentStatus = PathfinderStatus.Incative; AvaliableThread.Abort(); AvaliableThread = null; CurrentNM = null; PFM = null; }