* @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 */
| 167 | * except diagonal steps which are times 3 |
| 168 | */ |
| 169 | int CheckEqual(Point startPosition, Point destinationPosition) |
| 170 | { |
| 171 | if (startPosition.x == destinationPosition.x || startPosition.y == destinationPosition.y) |
| 172 | return 2; |
| 173 | |
| 174 | return 3; |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * @brief update all path costs using depth-first search starting at pPath |
no outgoing calls
no test coverage detected