1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 03:23:15 +01:00

Rename action functions to UpperCamelCase

This commit is contained in:
Stephan Spengler
2023-01-16 22:16:29 +01:00
committed by GitHub
parent 6dafbbfb65
commit ceb9aee1a7
12 changed files with 28 additions and 28 deletions

View File

@@ -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;

View File

@@ -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;
};

View File

@@ -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)
{

View File

@@ -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;
};

View File

@@ -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)
{

View File

@@ -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);
};

View File

@@ -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)

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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));
};