MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetTileDesc_Station

Function GetTileDesc_Station

src/station_cmd.cpp:3653–3685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3651}
3652
3653static void GetTileDesc_Station(TileIndex tile, TileDesc &td)
3654{
3655 td.owner[0] = GetTileOwner(tile);
3656 td.build_date = BaseStation::GetByTile(tile)->build_date;
3657
3658 if (IsAnyRoadStop(tile)) FillTileDescRoadStop(tile, td);
3659 if (HasStationRail(tile)) FillTileDescRailStation(tile, td);
3660 if (IsAirport(tile)) FillTileDescAirport(tile, td);
3661
3662 StringID str;
3663 switch (GetStationType(tile)) {
3664 default: NOT_REACHED();
3665 case StationType::Rail: str = STR_LAI_STATION_DESCRIPTION_RAILROAD_STATION; break;
3666 case StationType::Airport:
3667 str = (IsHangar(tile) ? STR_LAI_STATION_DESCRIPTION_AIRCRAFT_HANGAR : STR_LAI_STATION_DESCRIPTION_AIRPORT);
3668 break;
3669 case StationType::Truck: str = STR_LAI_STATION_DESCRIPTION_TRUCK_LOADING_AREA; break;
3670 case StationType::Bus: str = STR_LAI_STATION_DESCRIPTION_BUS_STATION; break;
3671 case StationType::Oilrig: {
3672 const Industry *i = Station::GetByTile(tile)->industry;
3673 const IndustrySpec *is = GetIndustrySpec(i->type);
3674 td.owner[0] = i->owner;
3675 str = is->name;
3676 if (is->grf_prop.HasGrfFile()) td.grf = GetGRFConfig(is->grf_prop.grfid)->GetName();
3677 break;
3678 }
3679 case StationType::Dock: str = STR_LAI_STATION_DESCRIPTION_SHIP_DOCK; break;
3680 case StationType::Buoy: str = STR_LAI_STATION_DESCRIPTION_BUOY; break;
3681 case StationType::RailWaypoint: str = STR_LAI_STATION_DESCRIPTION_WAYPOINT; break;
3682 case StationType::RoadWaypoint: str = STR_LAI_STATION_DESCRIPTION_WAYPOINT; break;
3683 }
3684 td.str = str;
3685}
3686
3687
3688static TrackStatus GetTileTrackStatus_Station(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)

Callers

nothing calls this directly

Calls 14

GetTileOwnerFunction · 0.85
IsAnyRoadStopFunction · 0.85
FillTileDescRoadStopFunction · 0.85
HasStationRailFunction · 0.85
FillTileDescRailStationFunction · 0.85
IsAirportFunction · 0.85
FillTileDescAirportFunction · 0.85
GetStationTypeFunction · 0.85
NOT_REACHEDFunction · 0.85
IsHangarFunction · 0.85
GetIndustrySpecFunction · 0.85
GetGRFConfigFunction · 0.85

Tested by

no test coverage detected