public PathReturn(int id, PathfindingResult result, List <Point3> path, PathFound callback, IPathfindingGrid grid)
 {
     ID       = id;
     Result   = result;
     Path     = path;
     Callback = callback;
     Grid     = grid;
 }
Beispiel #2
0
 private PathfindingRequest(int x, int y, int ex, int ey, PathFound foundEvent, List <PNode> existing = null)
 {
     this.StartX       = x;
     this.StartY       = y;
     this.EndX         = ex;
     this.EndY         = ey;
     this.ReturnEvent  = foundEvent;
     this.ExistingList = existing;
 }
 private PathfindingRequest(IPathfindingGrid grid, int id, Point3 start, Point3 end, PathFound foundEvent, bool overSized, List <Point3> path)
 {
     Start       = start;
     End         = end;
     ReturnEvent = foundEvent;
     Path        = path;
     Grid        = grid;
     ID          = id;
     IsOversized = overSized;
 }
Beispiel #4
0
        public static PathfindingRequest Create(int startX, int startY, int endX, int endY, PathFound foundEvent, List <PNode> existingList = null)
        {
            PathfindingRequest r;

            if (Pooled.Count > 0)
            {
                r              = Pooled.Dequeue();
                r.StartX       = startX;
                r.StartY       = startY;
                r.EndX         = endX;
                r.EndY         = endY;
                r.ReturnEvent  = foundEvent;
                r.ExistingList = existingList;
            }
            else
            {
                r = new PathfindingRequest(startX, startY, endX, endY, foundEvent, existingList);
            }

            if (PathfindingManager.Instance != null)
            {
                PathfindingManager.Instance.Enqueue(r);
            }

            return(r);
        }
        public static PathfindingRequest Create(IPathfindingGrid grid, int id, Point3 start, Point3 end, PathFound foundEvent, bool overSized, List <Point3> path)
        {
            PathfindingRequest r;

            if (_pooled.Count > 0)
            {
                r             = _pooled.Dequeue();
                r.Start       = start;
                r.End         = end;
                r.ReturnEvent = foundEvent;
                r.Path        = path;
                r.ID          = id;
                r.Grid        = grid;
                r.IsOversized = overSized;
            }
            else
            {
                r = new PathfindingRequest(grid, id, start, end, foundEvent, overSized, path);
            }
            World.Get <PathfindingSystem>().Enqueue(r);
            return(r);
        }