| 81 | static RoadStopPickerSelection _roadstop_gui; |
| 82 | |
| 83 | static bool IsRoadStopEverAvailable(const RoadStopSpec *spec, StationType type) |
| 84 | { |
| 85 | if (spec == nullptr) return true; |
| 86 | |
| 87 | if (spec->flags.Test(RoadStopSpecFlag::RoadOnly) && !RoadTypeIsRoad(_cur_roadtype)) return false; |
| 88 | if (spec->flags.Test(RoadStopSpecFlag::TramOnly) && !RoadTypeIsTram(_cur_roadtype)) return false; |
| 89 | |
| 90 | switch (spec->stop_type) { |
| 91 | case ROADSTOPTYPE_ALL: return true; |
| 92 | case ROADSTOPTYPE_PASSENGER: return type == StationType::Bus; |
| 93 | case ROADSTOPTYPE_FREIGHT: return type == StationType::Truck; |
| 94 | default: NOT_REACHED(); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Check whether a road stop type can be built. |
no test coverage detected