* @brief return a node for a position on the frontier, or NULL if not found */
| 58 | * @brief return a node for a position on the frontier, or NULL if not found |
| 59 | */ |
| 60 | uint16_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) |