* Towns must all be placed on the same grid or when they eventually * interpenetrate their road networks will not mesh nicely; this * function tells you if a tile is properly aligned. * * @param tile The tile to start at. * @param layout The town layout in effect. * @return true if the tile is in the correct location. */
| 2314 | * @return true if the tile is in the correct location. |
| 2315 | */ |
| 2316 | static bool IsTileAlignedToGrid(TileIndex tile, TownLayout layout) |
| 2317 | { |
| 2318 | switch (layout) { |
| 2319 | case TL_2X2_GRID: return TileX(tile) % 3 == 0 && TileY(tile) % 3 == 0; |
| 2320 | case TL_3X3_GRID: return TileX(tile) % 4 == 0 && TileY(tile) % 4 == 0; |
| 2321 | default: return true; |
| 2322 | } |
| 2323 | } |
| 2324 | |
| 2325 | /** |
| 2326 | * Given a spot on the map (presumed to be a water tile), find a good |
no test coverage detected