* Towns must all be placed on the same grid or when they eventually * interpenetrate their road networks will not mesh nicely; this * function adjusts a tile so that it aligns properly. * * @param tile The tile to start at. * @param layout The town layout in effect. * @return The adjusted tile. */
| 2296 | * @return The adjusted tile. |
| 2297 | */ |
| 2298 | static TileIndex AlignTileToGrid(TileIndex tile, TownLayout layout) |
| 2299 | { |
| 2300 | switch (layout) { |
| 2301 | case TL_2X2_GRID: return TileXY(TileX(tile) - TileX(tile) % 3, TileY(tile) - TileY(tile) % 3); |
| 2302 | case TL_3X3_GRID: return TileXY(TileX(tile) & ~3, TileY(tile) & ~3); |
| 2303 | default: return tile; |
| 2304 | } |
| 2305 | } |
| 2306 | |
| 2307 | /** |
| 2308 | * Towns must all be placed on the same grid or when they eventually |
no test coverage detected