* Gets the Manhattan distance between the two given tiles. * The Manhattan distance is the sum of the delta of both the * X and Y component. * Also known as L1-Norm * @param t0 the start tile * @param t1 the end tile * @return the distance */
| 167 | * @return the distance |
| 168 | */ |
| 169 | uint DistanceManhattan(TileIndex t0, TileIndex t1) |
| 170 | { |
| 171 | const uint dx = Delta(TileX(t0), TileX(t1)); |
| 172 | const uint dy = Delta(TileY(t0), TileY(t1)); |
| 173 | return dx + dy; |
| 174 | } |
| 175 | |
| 176 | |
| 177 | /** |
no test coverage detected