From ceb9aee1a736f37518afcb2de5e37e1d88267ea8 Mon Sep 17 00:00:00 2001 From: Stephan Spengler Date: Mon, 16 Jan 2023 22:16:29 +0100 Subject: [PATCH] Rename action functions to UpperCamelCase --- src/openrct2/actions/FootpathPlaceAction.cpp | 6 +++--- src/openrct2/actions/FootpathPlaceAction.h | 2 +- src/openrct2/actions/LandBuyRightsAction.cpp | 4 ++-- src/openrct2/actions/LandBuyRightsAction.h | 2 +- src/openrct2/actions/LandSetHeightAction.cpp | 4 ++-- src/openrct2/actions/LandSetHeightAction.h | 2 +- src/openrct2/actions/LandSetRightsAction.cpp | 4 ++-- src/openrct2/actions/LandSetRightsAction.h | 2 +- src/openrct2/actions/RideSetSettingAction.cpp | 16 ++++++++-------- src/openrct2/actions/RideSetSettingAction.h | 8 ++++---- src/openrct2/actions/RideSetVehicleAction.cpp | 4 ++-- src/openrct2/actions/RideSetVehicleAction.h | 2 +- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index da5ee82f7e..43fc61541d 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -103,7 +103,7 @@ GameActions::Result FootpathPlaceAction::Query() const } FootpathProvisionalRemove(); - auto tileElement = map_get_footpath_element_slope(_loc, _slope); + auto tileElement = MapGetFootpathElementSlope(_loc, _slope); if (tileElement == nullptr) { return ElementInsertQuery(std::move(res)); @@ -144,7 +144,7 @@ GameActions::Result FootpathPlaceAction::Execute() const } } - auto tileElement = map_get_footpath_element_slope(_loc, _slope); + auto tileElement = MapGetFootpathElementSlope(_loc, _slope); if (tileElement == nullptr) { return ElementInsertExecute(std::move(res)); @@ -508,7 +508,7 @@ void FootpathPlaceAction::RemoveIntersectingWalls(PathElement* pathElement) cons MapInvalidateTileFull(_loc); } -PathElement* FootpathPlaceAction::map_get_footpath_element_slope(const CoordsXYZ& footpathPos, int32_t slope) const +PathElement* FootpathPlaceAction::MapGetFootpathElementSlope(const CoordsXYZ& footpathPos, int32_t slope) const { const bool isSloped = slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; const auto slopeDirection = slope & FOOTPATH_PROPERTIES_SLOPE_DIRECTION_MASK; diff --git a/src/openrct2/actions/FootpathPlaceAction.h b/src/openrct2/actions/FootpathPlaceAction.h index 06a3009e21..8aa90434b3 100644 --- a/src/openrct2/actions/FootpathPlaceAction.h +++ b/src/openrct2/actions/FootpathPlaceAction.h @@ -42,7 +42,7 @@ private: GameActions::Result ElementInsertExecute(GameActions::Result res) const; void AutomaticallySetPeepSpawn() const; void RemoveIntersectingWalls(PathElement* pathElement) const; - PathElement* map_get_footpath_element_slope(const CoordsXYZ& footpathPos, int32_t slope) const; + PathElement* MapGetFootpathElementSlope(const CoordsXYZ& footpathPos, int32_t slope) const; bool IsSameAsPathElement(const PathElement* pathElement) const; bool IsSameAsEntranceElement(const EntranceElement& entranceElement) const; }; diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index 4278f17882..02e3be8fa9 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -92,7 +92,7 @@ GameActions::Result LandBuyRightsAction::QueryExecute(bool isExecuting) const { if (!LocationValid({ x, y })) continue; - auto result = map_buy_land_rights_for_tile({ x, y }, isExecuting); + auto result = MapBuyLandRightsForTile({ x, y }, isExecuting); if (result.Error == GameActions::Status::Ok) { res.Cost += result.Cost; @@ -106,7 +106,7 @@ GameActions::Result LandBuyRightsAction::QueryExecute(bool isExecuting) const return res; } -GameActions::Result LandBuyRightsAction::map_buy_land_rights_for_tile(const CoordsXY& loc, bool isExecuting) const +GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const { if (_setting >= LandBuyRightSetting::Count) { diff --git a/src/openrct2/actions/LandBuyRightsAction.h b/src/openrct2/actions/LandBuyRightsAction.h index 878c4ae938..fc6ed77514 100644 --- a/src/openrct2/actions/LandBuyRightsAction.h +++ b/src/openrct2/actions/LandBuyRightsAction.h @@ -44,5 +44,5 @@ public: private: GameActions::Result QueryExecute(bool isExecuting) const; - GameActions::Result map_buy_land_rights_for_tile(const CoordsXY& loc, bool isExecuting) const; + GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const; }; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index 5a20fa6c72..7233d1cb79 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -134,7 +134,7 @@ GameActions::Result LandSetHeightAction::Query() const } auto clearResult = MapCanConstructWithClearAt( - { _coords, _height * COORDS_Z_STEP, zCorner * COORDS_Z_STEP }, &map_set_land_height_clear_func, { 0b1111, 0 }, 0, + { _coords, _height * COORDS_Z_STEP, zCorner * COORDS_Z_STEP }, &MapSetLandHeightClearFunc, { 0b1111, 0 }, 0, CREATE_CROSSING_MODE_NONE); if (clearResult.Error != GameActions::Status::Ok) { @@ -347,7 +347,7 @@ void LandSetHeightAction::SetSurfaceHeight(TileElement* surfaceElement) const MapInvalidateTileFull(_coords); } -int32_t LandSetHeightAction::map_set_land_height_clear_func( +int32_t LandSetHeightAction::MapSetLandHeightClearFunc( TileElement** tile_element, [[maybe_unused]] const CoordsXY& coords, [[maybe_unused]] uint8_t flags, [[maybe_unused]] money32* price) { diff --git a/src/openrct2/actions/LandSetHeightAction.h b/src/openrct2/actions/LandSetHeightAction.h index df3b9d9bd5..78913f2303 100644 --- a/src/openrct2/actions/LandSetHeightAction.h +++ b/src/openrct2/actions/LandSetHeightAction.h @@ -44,7 +44,7 @@ private: * * rct2: 0x00663CB9 */ - static int32_t map_set_land_height_clear_func( + static int32_t MapSetLandHeightClearFunc( TileElement** tile_element, [[maybe_unused]] const CoordsXY& coords, [[maybe_unused]] uint8_t flags, [[maybe_unused]] money32* price); }; diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 5b16e25ce0..5155ee16a5 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -94,7 +94,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const { if (!LocationValid({ x, y })) continue; - auto result = map_buy_land_rights_for_tile({ x, y }, isExecuting); + auto result = MapBuyLandRightsForTile({ x, y }, isExecuting); if (result.Error == GameActions::Status::Ok) { res.Cost += result.Cost; @@ -110,7 +110,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const return res; } -GameActions::Result LandSetRightsAction::map_buy_land_rights_for_tile(const CoordsXY& loc, bool isExecuting) const +GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const { SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) diff --git a/src/openrct2/actions/LandSetRightsAction.h b/src/openrct2/actions/LandSetRightsAction.h index 7eee3910cc..8dddd494b3 100644 --- a/src/openrct2/actions/LandSetRightsAction.h +++ b/src/openrct2/actions/LandSetRightsAction.h @@ -43,5 +43,5 @@ public: private: GameActions::Result QueryExecute(bool isExecuting) const; - GameActions::Result map_buy_land_rights_for_tile(const CoordsXY& loc, bool isExecuting) const; + GameActions::Result MapBuyLandRightsForTile(const CoordsXY& loc, bool isExecuting) const; }; diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 5d92868295..06f483d4c2 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -64,7 +64,7 @@ GameActions::Result RideSetSettingAction::Query() const GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_MUST_BE_CLOSED_FIRST); } - if (!ride_is_mode_valid(*ride) && !gCheatsShowAllOperatingModes) + if (!RideIsModeValid(*ride) && !gCheatsShowAllOperatingModes) { log_warning("Invalid ride mode: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); @@ -87,7 +87,7 @@ GameActions::Result RideSetSettingAction::Query() const } break; case RideSetSetting::Operation: - if (!ride_is_valid_operation_option(*ride)) + if (!RideIsValidOperationOption(*ride)) { log_warning("Invalid operation option value: %u", _value); return GameActions::Result( @@ -115,7 +115,7 @@ GameActions::Result RideSetSettingAction::Query() const break; } case RideSetSetting::LiftHillSpeed: - if (!ride_is_valid_lift_hill_speed(*ride)) + if (!RideIsValidLiftHillSpeed(*ride)) { log_warning("Invalid lift hill speed: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); @@ -129,7 +129,7 @@ GameActions::Result RideSetSettingAction::Query() const STR_MULTICIRCUIT_NOT_POSSIBLE_WITH_CABLE_LIFT_HILL); } - if (!ride_is_valid_num_circuits()) + if (!RideIsValidNumCircuits()) { log_warning("Invalid number of circuits: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); @@ -240,26 +240,26 @@ GameActions::Result RideSetSettingAction::Execute() const return res; } -bool RideSetSettingAction::ride_is_mode_valid(const Ride& ride) const +bool RideSetSettingAction::RideIsModeValid(const Ride& ride) const { return ride.GetRideTypeDescriptor().RideModes & (1uLL << _value); } -bool RideSetSettingAction::ride_is_valid_lift_hill_speed(const Ride& ride) const +bool RideSetSettingAction::RideIsValidLiftHillSpeed(const Ride& ride) const { int32_t minSpeed = gCheatsUnlockOperatingLimits ? 0 : ride.GetRideTypeDescriptor().LiftData.minimum_speed; int32_t maxSpeed = gCheatsUnlockOperatingLimits ? 255 : ride.GetRideTypeDescriptor().LiftData.maximum_speed; return _value >= minSpeed && _value <= maxSpeed; } -bool RideSetSettingAction::ride_is_valid_num_circuits() const +bool RideSetSettingAction::RideIsValidNumCircuits() const { int32_t minNumCircuits = 1; int32_t maxNumCircuits = gCheatsUnlockOperatingLimits ? 255 : OpenRCT2::Limits::MaxCircuitsPerRide; return _value >= minNumCircuits && _value <= maxNumCircuits; } -bool RideSetSettingAction::ride_is_valid_operation_option(const Ride& ride) const +bool RideSetSettingAction::RideIsValidOperationOption(const Ride& ride) const { const auto& operatingSettings = ride.GetRideTypeDescriptor().OperatingSettings; uint8_t minValue = operatingSettings.MinValue; diff --git a/src/openrct2/actions/RideSetSettingAction.h b/src/openrct2/actions/RideSetSettingAction.h index 3212894315..04a8c59c0f 100644 --- a/src/openrct2/actions/RideSetSettingAction.h +++ b/src/openrct2/actions/RideSetSettingAction.h @@ -46,9 +46,9 @@ public: GameActions::Result Execute() const override; private: - bool ride_is_mode_valid(const Ride& ride) const; - bool ride_is_valid_lift_hill_speed(const Ride& ride) const; - bool ride_is_valid_num_circuits() const; - bool ride_is_valid_operation_option(const Ride& ride) const; + bool RideIsModeValid(const Ride& ride) const; + bool RideIsValidLiftHillSpeed(const Ride& ride) const; + bool RideIsValidNumCircuits() const; + bool RideIsValidOperationOption(const Ride& ride) const; StringId GetOperationErrorMessage(const Ride& ride) const; }; diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 9e597f216b..14c730f9c5 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -90,7 +90,7 @@ GameActions::Result RideSetVehicleAction::Query() const break; case RideSetVehicleType::RideEntry: { - if (!ride_is_vehicle_type_valid(*ride)) + if (!RideIsVehicleTypeValid(*ride)) { log_error("Invalid vehicle type. type = %d", _value); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); @@ -208,7 +208,7 @@ GameActions::Result RideSetVehicleAction::Execute() const return res; } -bool RideSetVehicleAction::ride_is_vehicle_type_valid(const Ride& ride) const +bool RideSetVehicleAction::RideIsVehicleTypeValid(const Ride& ride) const { bool selectionShouldBeExpanded; int32_t rideTypeIterator, rideTypeIteratorMax; diff --git a/src/openrct2/actions/RideSetVehicleAction.h b/src/openrct2/actions/RideSetVehicleAction.h index 519caf50b6..dac2df252f 100644 --- a/src/openrct2/actions/RideSetVehicleAction.h +++ b/src/openrct2/actions/RideSetVehicleAction.h @@ -40,7 +40,7 @@ public: GameActions::Result Execute() const override; private: - bool ride_is_vehicle_type_valid(const Ride& ride) const; + bool RideIsVehicleTypeValid(const Ride& ride) const; static_assert(sizeof(_value) >= sizeof(ObjectEntryIndex)); };