MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / reconstructPath

Method reconstructPath

source/core/StarAStar.hpp:259–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257
258 template <class Edge, class Node>
259 Path<Edge> Search<Edge, Node>::reconstructPath(Node currentNode) {
260 Path<Edge> res; // this will be backwards, we reverse it before returning it.
261 while (m_nodeMeta.find(currentNode) != m_nodeMeta.end()) {
262 Maybe<Edge> currentEdge = m_nodeMeta[currentNode].cameFrom;
263 if (currentEdge.isNothing())
264 break;
265 res.append(*currentEdge);
266 currentNode = currentEdge->source;
267 }
268 std::reverse(res.begin(), res.end());
269 return res;
270 }
271}
272
273}

Callers

nothing calls this directly

Calls 6

isNothingMethod · 0.80
reverseFunction · 0.70
findMethod · 0.45
endMethod · 0.45
appendMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected