1
0
Fork 0

Codefix 75387b9e2b: Prefer using EnumBitSet.base() instead of shifting StationFacility. (#13575)

pull/13582/head
Peter Nelson 2025-02-16 11:52:40 +00:00 committed by GitHub
parent e8beb0eff3
commit 443d7ece29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -44,11 +44,11 @@ public:
*/
enum StationType {
/* Note: these values represent part of the in-game StationFacilities enum */
STATION_TRAIN = (1 << to_underlying(::StationFacility::Train)), ///< Train station
STATION_TRUCK_STOP = (1 << to_underlying(::StationFacility::TruckStop)), ///< Truck station
STATION_BUS_STOP = (1 << to_underlying(::StationFacility::BusStop)), ///< Bus station
STATION_AIRPORT = (1 << to_underlying(::StationFacility::Airport)), ///< Airport
STATION_DOCK = (1 << to_underlying(::StationFacility::Dock)), ///< Dock
STATION_TRAIN = ::StationFacilities{::StationFacility::Train}.base(), ///< Train station
STATION_TRUCK_STOP = ::StationFacilities{::StationFacility::TruckStop}.base(), ///< Truck station
STATION_BUS_STOP = ::StationFacilities{::StationFacility::BusStop}.base(), ///< Bus station
STATION_AIRPORT = ::StationFacilities{::StationFacility::Airport}.base(), ///< Airport
STATION_DOCK = ::StationFacilities{::StationFacility::Dock}.base(), ///< Dock
STATION_ANY = STATION_TRAIN | STATION_TRUCK_STOP | STATION_BUS_STOP | STATION_AIRPORT | STATION_DOCK, ///< All station types
};

View File

@ -41,8 +41,8 @@ public:
*/
enum WaypointType {
/* Note: these values represent part of the in-game StationFacilities enum */
WAYPOINT_RAIL = (1U << to_underlying(::StationFacility::Train)), ///< Rail waypoint
WAYPOINT_BUOY = (1U << to_underlying(::StationFacility::Dock)), ///< Buoy
WAYPOINT_RAIL = ::StationFacilities{::StationFacility::Train}.base(), ///< Rail waypoint
WAYPOINT_BUOY = ::StationFacilities{::StationFacility::Dock}.base(), ///< Buoy
WAYPOINT_ANY = WAYPOINT_RAIL | WAYPOINT_BUOY, ///< All waypoint types
};