* @brief return 2 if pPath is horizontally/vertically aligned with (dx,dy), else 3 * * This approximates that diagonal movement on a square grid should have a cost * of sqrt(2). That's approximately 1.5, so they multiply all step costs by 2, * except diagonal steps which are times 3 */
| 109 | * except diagonal steps which are times 3 |
| 110 | */ |
| 111 | int path_check_equal(PATHNODE *pPath, int dx, int dy) |
| 112 | { |
| 113 | if (pPath->x == dx || pPath->y == dy) |
| 114 | return 2; |
| 115 | |
| 116 | return 3; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * @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 |
no outgoing calls
no test coverage detected