* Gets the biggest distance component (x or y) between the two given tiles * plus the Manhattan distance, i.e. two times the biggest distance component * and once the smallest component. * @param t0 the start tile * @param t1 the end tile * @return the distance */
| 215 | * @return the distance |
| 216 | */ |
| 217 | uint DistanceMaxPlusManhattan(TileIndex t0, TileIndex t1) |
| 218 | { |
| 219 | const uint dx = Delta(TileX(t0), TileX(t1)); |
| 220 | const uint dy = Delta(TileY(t0), TileY(t1)); |
| 221 | return dx > dy ? 2 * dx + dy : 2 * dy + dx; |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * Param the minimum distance to an edge |
no test coverage detected