private PawnPath FinalizedPath(int finalIndex, bool usedRegionHeuristics) { PawnPath emptyPawnPath = map.pawnPathPool.GetEmptyPawnPath(); int num = finalIndex; while (true) { int parentIndex = calcGrid[num].parentIndex; emptyPawnPath.AddNode(map.cellIndices.IndexToCell(num)); if (num == parentIndex) { break; } num = parentIndex; } emptyPawnPath.SetupFound(calcGrid[finalIndex].knownCost, usedRegionHeuristics); return(emptyPawnPath); }
private PawnPath FinalizedPath(int finalIndex, bool usedRegionHeuristics) { PawnPath emptyPawnPath = this.map.pawnPathPool.GetEmptyPawnPath(); int num = finalIndex; for (;;) { PathFinder.PathFinderNodeFast pathFinderNodeFast = this.calcGrid[num]; int parentIndex = pathFinderNodeFast.parentIndex; emptyPawnPath.AddNode(this.map.cellIndices.IndexToCell(num)); if (num == parentIndex) { break; } num = parentIndex; } emptyPawnPath.SetupFound((float)this.calcGrid[finalIndex].knownCost, usedRegionHeuristics); return(emptyPawnPath); }
private PawnPath FinalizedPath(int finalIndex) { PawnPath emptyPawnPath = pathPool.GetEmptyPawnPath(); int num = finalIndex; while (true) { newPathFinder.PathFinderNodeFast pathFinderNodeFast = this.calcGrid[num]; int parentIndex = pathFinderNodeFast.parentIndex; emptyPawnPath.AddNode(this.map.cellIndices.IndexToCell(num)); if (num == parentIndex) { break; } num = parentIndex; } emptyPawnPath.SetupFound((float)this.calcGrid[finalIndex].knownCost); return(emptyPawnPath); }