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

Function GetGrfSpecFeature

src/newgrf_debug_gui.cpp:760–779  ·  view source on GitHub ↗

* Get the GrfSpecFeature associated with the tile. * @param tile The tile to get the feature from. * @return the GrfSpecFeature. */

Source from the content-addressed store, hash-verified

758 * @return the GrfSpecFeature.
759 */
760GrfSpecFeature GetGrfSpecFeature(TileIndex tile)
761{
762 switch (GetTileType(tile)) {
763 default: return GSF_INVALID;
764 case MP_RAILWAY: return GSF_RAILTYPES;
765 case MP_ROAD: return IsLevelCrossing(tile) ? GSF_RAILTYPES : GSF_ROADTYPES;
766 case MP_HOUSE: return GSF_HOUSES;
767 case MP_INDUSTRY: return GSF_INDUSTRYTILES;
768 case MP_OBJECT: return GSF_OBJECTS;
769
770 case MP_STATION:
771 switch (GetStationType(tile)) {
772 case StationType::Rail: return GSF_STATIONS;
773 case StationType::Airport: return GSF_AIRPORTTILES;
774 case StationType::Bus: return GSF_ROADSTOPS;
775 case StationType::Truck: return GSF_ROADSTOPS;
776 default: return GSF_INVALID;
777 }
778 }
779}
780
781/**
782 * Get the GrfSpecFeature associated with the vehicle.

Callers 6

IsNewGRFInspectableMethod · 0.85
~VehicleMethod · 0.85
IsNewGRFInspectableMethod · 0.85
GetParentMethod · 0.85

Calls 3

GetTileTypeFunction · 0.85
IsLevelCrossingFunction · 0.85
GetStationTypeFunction · 0.85

Tested by

no test coverage detected