* @brief return a node for this position if it was visited, or NULL if not found */
| 96 | * @brief return a node for this position if it was visited, or NULL if not found |
| 97 | */ |
| 98 | uint16_t GetNode2(Point targetPosition) |
| 99 | { |
| 100 | uint16_t result = VisitedNodes->nextNodeIndex; |
| 101 | while (result != PathNode::InvalidIndex) { |
| 102 | if (PathNodes[result].position() == targetPosition) |
| 103 | return result; |
| 104 | result = PathNodes[result].nextNodeIndex; |
| 105 | } |
| 106 | return result; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * @brief get the next node on the A* frontier to explore (estimated to be closest to the goal), mark it as visited, and return it |