* Set the reservation for a complete station platform. * @pre IsRailStationTile(start) * @param start starting tile of the platform * @param dir the direction in which to follow the platform * @param b the state the reservation should be set to */
| 55 | * @param b the state the reservation should be set to |
| 56 | */ |
| 57 | void SetRailStationPlatformReservation(TileIndex start, DiagDirection dir, bool b) |
| 58 | { |
| 59 | TileIndex tile = start; |
| 60 | TileIndexDiff diff = TileOffsByDiagDir(dir); |
| 61 | |
| 62 | assert(IsRailStationTile(start)); |
| 63 | assert(GetRailStationAxis(start) == DiagDirToAxis(dir)); |
| 64 | |
| 65 | do { |
| 66 | SetRailStationReservation(tile, b); |
| 67 | MarkTileDirtyByTile(tile); |
| 68 | tile = TileAdd(tile, diff); |
| 69 | } while (IsCompatibleTrainStationTile(tile, start)); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Try to reserve a specific track on a tile |
no test coverage detected