* Get the catchment size of an individual station tile. * @param tile Station tile to get catchment size of. * @param st Associated station of station tile. * @pre IsTileType(tile, MP_STATION) * @return The catchment size of the station tile. */
| 309 | * @return The catchment size of the station tile. |
| 310 | */ |
| 311 | static uint GetTileCatchmentRadius(TileIndex tile, const Station *st) |
| 312 | { |
| 313 | assert(IsTileType(tile, MP_STATION)); |
| 314 | |
| 315 | if (_settings_game.station.modified_catchment) { |
| 316 | switch (GetStationType(tile)) { |
| 317 | case StationType::Rail: return CA_TRAIN; |
| 318 | case StationType::Oilrig: return CA_UNMODIFIED; |
| 319 | case StationType::Airport: return st->airport.GetSpec()->catchment; |
| 320 | case StationType::Truck: return CA_TRUCK; |
| 321 | case StationType::Bus: return CA_BUS; |
| 322 | case StationType::Dock: return CA_DOCK; |
| 323 | |
| 324 | default: NOT_REACHED(); |
| 325 | case StationType::Buoy: |
| 326 | case StationType::RailWaypoint: |
| 327 | case StationType::RoadWaypoint: return CA_NONE; |
| 328 | } |
| 329 | } else { |
| 330 | switch (GetStationType(tile)) { |
| 331 | default: return CA_UNMODIFIED; |
| 332 | case StationType::Buoy: |
| 333 | case StationType::RailWaypoint: |
| 334 | case StationType::RoadWaypoint: return CA_NONE; |
| 335 | } |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | /** |
| 340 | * Determines the catchment radius of the station |
no test coverage detected