| 21 | } |
| 22 | |
| 23 | inline uint32_t calc_distance(df::coord p1, df::coord p2) { |
| 24 | // calculate chebyshev (chessboard) distance |
| 25 | uint32_t distance = abs(p2.z - p1.z); |
| 26 | distance += std::max(abs(p2.x - p1.x), abs(p2.y - p1.y)); |
| 27 | return distance; |
| 28 | } |
| 29 | |
| 30 | inline void get_connected_neighbours(const df::coord &map_pos, df::coord(&neighbours)[4]) { |
| 31 | neighbours[0] = map_pos; |
no outgoing calls
no test coverage detected