MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / GetNode1

Function GetNode1

Source/engine/path.cpp:60–69  ·  view source on GitHub ↗

* @brief return a node for a position on the frontier, or NULL if not found */

Source from the content-addressed store, hash-verified

58 * @brief return a node for a position on the frontier, or NULL if not found
59 */
60uint16_t GetNode1(Point targetPosition)
61{
62 uint16_t result = Path2Nodes->nextNodeIndex;
63 while (result != PathNode::InvalidIndex) {
64 if (PathNodes[result].position() == targetPosition)
65 return result;
66 result = PathNodes[result].nextNodeIndex;
67 }
68 return PathNode::InvalidIndex;
69}
70
71/**
72 * @brief insert `front` node into the frontier (keeping the frontier sorted by total distance)

Callers 1

ParentPathFunction · 0.85

Calls 1

positionMethod · 0.80

Tested by

no test coverage detected