mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use enum class for ExpenditureType
This commit is contained in:
parent
79acb6a073
commit
52ee9c6896
|
@ -495,7 +495,7 @@ static constexpr const int32_t EXPENDITURE_COLUMN_WIDTH = 80;
|
|||
|
||||
static int32_t _lastPaintedMonth;
|
||||
|
||||
static constexpr const rct_string_id window_finances_summary_row_labels[RCT_EXPENDITURE_TYPE_COUNT] = {
|
||||
static constexpr const rct_string_id window_finances_summary_row_labels[static_cast<int32_t>(ExpenditureType::Count)] = {
|
||||
STR_FINANCES_SUMMARY_RIDE_CONSTRUCTION,
|
||||
STR_FINANCES_SUMMARY_RIDE_RUNNING_COSTS,
|
||||
STR_FINANCES_SUMMARY_LAND_PURCHASE,
|
||||
|
@ -678,7 +678,7 @@ static void window_finances_summary_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
y += 14;
|
||||
|
||||
// Expenditure / Income row labels
|
||||
for (int32_t i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
for (int32_t i = 0; i < static_cast<int32_t>(ExpenditureType::Count); i++)
|
||||
{
|
||||
// Darken every even row
|
||||
if (i % 2 == 0)
|
||||
|
@ -726,7 +726,7 @@ static void window_finances_summary_scrollpaint(rct_window* w, rct_drawpixelinfo
|
|||
int32_t row_width = std::max<uint16_t>(w->scrolls[0].h_right, self.right - self.left);
|
||||
|
||||
// Expenditure / Income row labels
|
||||
for (int32_t i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
for (int32_t i = 0; i < static_cast<int32_t>(ExpenditureType::Count); i++)
|
||||
{
|
||||
// Darken every even row
|
||||
if (i % 2 == 0)
|
||||
|
@ -756,7 +756,7 @@ static void window_finances_summary_scrollpaint(rct_window* w, rct_drawpixelinfo
|
|||
|
||||
// Month expenditures
|
||||
money32 profit = 0;
|
||||
for (int32_t j = 0; j < RCT_EXPENDITURE_TYPE_COUNT; j++)
|
||||
for (int32_t j = 0; j < static_cast<int32_t>(ExpenditureType::Count); j++)
|
||||
{
|
||||
money32 expenditure = gExpenditureTable[i][j];
|
||||
if (expenditure != 0)
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->ErrorTitle = STR_CANT_POSITION_THIS_HERE;
|
||||
|
||||
if (!map_check_free_elements_and_reorganise(1))
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->ErrorTitle = STR_CANT_POSITION_THIS_HERE;
|
||||
|
||||
if (!map_check_free_elements_and_reorganise(1))
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
GameActionResult::Ptr Query() const override
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
|
|
|
@ -56,7 +56,7 @@ private:
|
|||
GameActionResult::Ptr QueryExecute(bool isExecuting) const
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = banner->position.x * 32 + 16;
|
||||
res->Position.y = banner->position.y * 32 + 16;
|
||||
res->Position.z = tile_element_height(res->Position);
|
||||
|
@ -115,7 +115,7 @@ public:
|
|||
|
||||
auto banner = GetBanner(_bannerIndex);
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = banner->position.x * 32 + 16;
|
||||
res->Position.y = banner->position.y * 32 + 16;
|
||||
res->Position.z = tile_element_height(res->Position);
|
||||
|
|
|
@ -74,7 +74,7 @@ private:
|
|||
{
|
||||
auto result = MakeResult();
|
||||
result->ErrorTitle = STR_UNABLE_TO_REMOVE_ALL_SCENERY_FROM_HERE;
|
||||
result->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
result->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
auto x = (_range.GetLeft() + _range.GetRight()) / 2 + 16;
|
||||
auto y = (_range.GetTop() + _range.GetBottom()) / 2 + 16;
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->Cost = 0;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = _loc;
|
||||
res->Position.x += 16;
|
||||
res->Position.y += 16;
|
||||
|
@ -110,7 +110,7 @@ public:
|
|||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->Cost = 0;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = _loc;
|
||||
res->Position.x += 16;
|
||||
res->Position.y += 16;
|
||||
|
@ -239,8 +239,8 @@ private:
|
|||
: CREATE_CROSSING_MODE_PATH_OVER_TRACK;
|
||||
if (!entrancePath
|
||||
&& !map_can_construct_with_clear_at(
|
||||
_loc.x, _loc.y, zLow, zHigh, &map_place_non_scenery_clear_func, quarterTile, GetFlags(), &res->Cost,
|
||||
crossingMode))
|
||||
_loc.x, _loc.y, zLow, zHigh, &map_place_non_scenery_clear_func, quarterTile, GetFlags(), &res->Cost,
|
||||
crossingMode))
|
||||
{
|
||||
return MakeResult(GA_ERROR::NO_CLEARANCE, STR_CANT_BUILD_FOOTPATH_HERE, gGameCommandErrorText, gCommonFormatArgs);
|
||||
}
|
||||
|
@ -304,8 +304,8 @@ private:
|
|||
: CREATE_CROSSING_MODE_PATH_OVER_TRACK;
|
||||
if (!entrancePath
|
||||
&& !map_can_construct_with_clear_at(
|
||||
_loc.x, _loc.y, zLow, zHigh, &map_place_non_scenery_clear_func, quarterTile,
|
||||
GAME_COMMAND_FLAG_APPLY | GetFlags(), &res->Cost, crossingMode))
|
||||
_loc.x, _loc.y, zLow, zHigh, &map_place_non_scenery_clear_func, quarterTile,
|
||||
GAME_COMMAND_FLAG_APPLY | GetFlags(), &res->Cost, crossingMode))
|
||||
{
|
||||
return MakeResult(GA_ERROR::NO_CLEARANCE, STR_CANT_BUILD_FOOTPATH_HERE, gGameCommandErrorText, gCommonFormatArgs);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->Cost = 0;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = _loc;
|
||||
res->Position.x += 16;
|
||||
res->Position.y += 16;
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->Cost = 0;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = _loc;
|
||||
res->Position.x += 16;
|
||||
res->Position.y += 16;
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->Cost = 0;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = { _loc.x + 16, _loc.y + 16, _loc.z };
|
||||
|
||||
if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !map_is_location_owned(_loc))
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->Cost = 0;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = { _loc.x + 16, _loc.y + 16, _loc.z };
|
||||
|
||||
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
GameActionResult::Ptr Query() const override
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = _loc;
|
||||
if (!map_is_location_valid(_loc))
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ public:
|
|||
{
|
||||
auto res = MakeResult();
|
||||
res->Position = _loc;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
auto tileElement = map_get_footpath_element(_loc.x / 32, _loc.y / 32, _loc.z / 8);
|
||||
auto pathElement = tileElement->AsPath();
|
||||
|
|
|
@ -412,7 +412,7 @@ namespace GameActions
|
|||
// Update money balance
|
||||
if (result->Error == GA_ERROR::OK && finance_check_money_required(flags) && result->Cost != 0)
|
||||
{
|
||||
finance_payment(result->Cost, result->ExpenditureType);
|
||||
finance_payment(result->Cost, result->Expenditure);
|
||||
rct_money_effect::Create(result->Cost, result->Position);
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
std::array<uint8_t, 32> ErrorMessageArgs;
|
||||
CoordsXYZ Position = { LOCATION_NULL, LOCATION_NULL, LOCATION_NULL };
|
||||
money32 Cost = 0;
|
||||
rct_expenditure_type ExpenditureType = RCT_EXPENDITURE_TYPE_COUNT;
|
||||
ExpenditureType Expenditure = ExpenditureType::Count;
|
||||
|
||||
GameActionResult() = default;
|
||||
GameActionResult(GA_ERROR error, rct_string_id message);
|
||||
|
|
|
@ -96,7 +96,7 @@ private:
|
|||
centre.z = tile_element_height(centre);
|
||||
|
||||
res->Position = centre;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE;
|
||||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
|
||||
// Game command modified to accept selection size
|
||||
for (auto y = validRange.GetTop(); y <= validRange.GetBottom(); y += 32)
|
||||
|
|
|
@ -84,7 +84,7 @@ private:
|
|||
MapRange validRange = MapRange{ aX, aY, bX, bY };
|
||||
|
||||
res->Position = { _coords.x, _coords.y, tile_element_height(_coords) };
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
if (isExecuting)
|
||||
{
|
||||
|
|
|
@ -85,7 +85,7 @@ private:
|
|||
MapRange validRange = MapRange{ aX, aY, bX, bY };
|
||||
|
||||
res->Position = { _coords.x, _coords.y, tile_element_height(_coords) };
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
if (isExecuting)
|
||||
{
|
||||
|
|
|
@ -140,7 +140,7 @@ public:
|
|||
}
|
||||
auto res = std::make_unique<GameActionResult>();
|
||||
res->Cost = sceneryRemovalCost + GetSurfaceHeightChangeCost(surfaceElement);
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ public:
|
|||
auto res = std::make_unique<GameActionResult>();
|
||||
res->Position = { _coords.x + 16, _coords.y + 16, surfaceHeight };
|
||||
res->Cost = cost;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ private:
|
|||
centre.z = tile_element_height(centre);
|
||||
|
||||
res->Position = centre;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE;
|
||||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !gCheatsSandboxMode)
|
||||
{
|
||||
|
|
|
@ -354,7 +354,7 @@ private:
|
|||
|
||||
auto res = MakeResult();
|
||||
res->ErrorTitle = _ErrorTitles[_isLowering ? 0 : 1];
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = { _coords.x, _coords.y, centreZ };
|
||||
|
||||
// Do the smoothing
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
{
|
||||
auto res = std::make_unique<LargeSceneryPlaceActionResult>();
|
||||
res->ErrorTitle = STR_CANT_POSITION_THIS_HERE;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
int16_t surfaceHeight = tile_element_height(_loc);
|
||||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Cost = 0;
|
||||
|
||||
TileElement* tileElement = FindLargeSceneryElement();
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Cost = 0;
|
||||
|
||||
TileElement* tileElement = FindLargeSceneryElement();
|
||||
|
|
|
@ -59,7 +59,7 @@ private:
|
|||
GameActionResult::Ptr QueryExecute(bool isExecuting) const
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = tile_element_height(_loc);
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
res->Position.x = _loc.x + 8;
|
||||
res->Position.y = _loc.y + 8;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
if (!map_check_free_elements_and_reorganise(1))
|
||||
{
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
res->Position.x = _loc.x + 8;
|
||||
res->Position.y = _loc.y + 8;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
|
||||
auto ride = get_ride(_rideIndex);
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
res->Position.x = _loc.x + 8;
|
||||
res->Position.y = _loc.y + 8;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
if (!map_check_free_elements_and_reorganise(1))
|
||||
{
|
||||
|
@ -179,7 +179,7 @@ public:
|
|||
res->Position.x = _loc.x + 8;
|
||||
res->Position.y = _loc.y + 8;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
|
||||
|
||||
auto ride = get_ride(_rideIndex);
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
}
|
||||
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE;
|
||||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
res->Position = _loc;
|
||||
res->ErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
|||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE;
|
||||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
res->Position = _loc;
|
||||
res->ErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ private:
|
|||
{
|
||||
auto result = MakeResult();
|
||||
result->ErrorTitle = STR_CANT_START_MARKETING_CAMPAIGN;
|
||||
result->ExpenditureType = RCT_EXPENDITURE_TYPE_MARKETING;
|
||||
result->Expenditure = ExpenditureType::Marketing;
|
||||
result->Cost = CalculatePrice();
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
}
|
||||
|
||||
auto res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE;
|
||||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
res->Position = { _loc.x, _loc.y, _loc.z };
|
||||
|
||||
if (!map_check_free_elements_and_reorganise(3))
|
||||
|
@ -113,7 +113,7 @@ public:
|
|||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
auto res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE;
|
||||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
res->Position = CoordsXYZ{ _loc.x, _loc.y, _loc.z };
|
||||
|
||||
uint32_t flags = GetFlags();
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
}
|
||||
|
||||
auto res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE;
|
||||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
res->Position = CoordsXYZ{ _location.x, _location.y, _location.z / 8 };
|
||||
|
||||
if (!map_check_free_elements_and_reorganise(3))
|
||||
|
@ -95,7 +95,7 @@ public:
|
|||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
auto res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LAND_PURCHASE;
|
||||
res->Expenditure = ExpenditureType::LandPurchase;
|
||||
res->Position = CoordsXYZ{ _location.x, _location.y, _location.z / 8 };
|
||||
|
||||
// If we have reached our max peep spawns, remove the oldest spawns
|
||||
|
|
|
@ -299,7 +299,7 @@ public:
|
|||
ride_set_vehicle_colours_to_random_preset(ride, _colour2);
|
||||
window_invalidate_by_class(WC_RIDE_LIST);
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -236,7 +236,7 @@ private:
|
|||
}
|
||||
|
||||
auto res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->Cost = refundPrice;
|
||||
|
||||
if (!ride->overall_view.isNull())
|
||||
|
@ -357,7 +357,7 @@ private:
|
|||
GameActionResult::Ptr RefurbishRide(Ride * ride) const
|
||||
{
|
||||
auto res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->Cost = GetRefurbishPrice(ride);
|
||||
|
||||
ride->Renew();
|
||||
|
|
|
@ -128,7 +128,7 @@ public:
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -186,7 +186,7 @@ public:
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
|
||||
TileElement* tileElement = tile_element_insert({ _loc.x / 32, _loc.y / 32, z / 8 }, 0b1111);
|
||||
assert(tileElement != nullptr);
|
||||
|
@ -269,7 +269,7 @@ public:
|
|||
res->Position.x = loc.x + 16;
|
||||
res->Position.y = loc.y + 16;
|
||||
res->Position.z = tile_element_height(loc);
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->ErrorTitle = STR_CANT_SET_COLOUR_SCHEME;
|
||||
|
||||
int32_t x = _loc.x, y = _loc.y, z = _loc.z;
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_PARK_RIDE_TICKETS;
|
||||
res->Expenditure = ExpenditureType::ParkRideTickets;
|
||||
|
||||
auto ride = get_ride(_rideIndex);
|
||||
if (ride == nullptr)
|
||||
|
|
|
@ -106,7 +106,7 @@ public:
|
|||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_RUNNING_COSTS;
|
||||
res->Expenditure = ExpenditureType::RideRunningCosts;
|
||||
|
||||
auto ride = get_ride(_rideIndex);
|
||||
if (ride == nullptr)
|
||||
|
|
|
@ -289,7 +289,7 @@ public:
|
|||
|
||||
res->GroundFlags = gMapGroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND);
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Cost = (sceneryEntry->small_scenery.price * 10) + clearCost;
|
||||
|
||||
return res;
|
||||
|
@ -427,7 +427,7 @@ public:
|
|||
|
||||
res->GroundFlags = gMapGroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND);
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Cost = (sceneryEntry->small_scenery.price * 10) + clearCost;
|
||||
|
||||
TileElement* newElement = tile_element_insert({ _loc.x / 32, _loc.y / 32, zLow }, quarterTile.GetBaseQuarterOccupied());
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
}
|
||||
|
||||
res->Cost = entry->small_scenery.removal_price * 10;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = _loc;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gCheatsSandboxMode)
|
||||
|
@ -115,7 +115,7 @@ public:
|
|||
}
|
||||
|
||||
res->Cost = entry->small_scenery.removal_price * 10;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position = _loc;
|
||||
|
||||
TileElement* tileElement = FindSceneryElement();
|
||||
|
|
|
@ -76,7 +76,7 @@ private:
|
|||
GameActionResult::Ptr QueryExecute(bool isExecuting) const
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
|
|
|
@ -95,7 +95,7 @@ private:
|
|||
{
|
||||
auto res = std::make_unique<StaffHireNewActionResult>();
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_WAGES;
|
||||
res->Expenditure = ExpenditureType::Wages;
|
||||
|
||||
if (_staffType >= STAFF_TYPE_COUNT)
|
||||
{
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
{
|
||||
auto res = MakeResult();
|
||||
res->ErrorTitle = STR_CANT_CHANGE_LAND_TYPE;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
auto normRange = _range.Normalise();
|
||||
auto x0 = std::max(normRange.GetLeft(), 32);
|
||||
|
@ -165,7 +165,7 @@ public:
|
|||
{
|
||||
auto res = MakeResult();
|
||||
res->ErrorTitle = STR_CANT_CHANGE_LAND_TYPE;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
auto normRange = _range.Normalise();
|
||||
auto x0 = std::max(normRange.GetLeft(), 32);
|
||||
|
|
|
@ -32,7 +32,7 @@ GameActionResult::Ptr TrackDesignAction::Query() const
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
_currentTrackPieceDirection = _loc.direction;
|
||||
|
||||
const rct_object_entry* rideEntryObject = &_td.vehicle_object;
|
||||
|
@ -124,7 +124,7 @@ GameActionResult::Ptr TrackDesignAction::Execute() const
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
|
||||
const rct_object_entry* rideEntryObject = &_td.vehicle_object;
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ public:
|
|||
}
|
||||
|
||||
auto res = std::make_unique<TrackPlaceActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->Position.x = _origin.x + 16;
|
||||
res->Position.y = _origin.y + 16;
|
||||
res->Position.z = _origin.z;
|
||||
|
@ -412,7 +412,7 @@ public:
|
|||
}
|
||||
|
||||
auto res = std::make_unique<TrackPlaceActionResult>();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
res->Position.x = _origin.x + 16;
|
||||
res->Position.y = _origin.y + 16;
|
||||
res->Position.z = _origin.z;
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
res->Position.x = _origin.x + 16;
|
||||
res->Position.y = _origin.y + 16;
|
||||
res->Position.z = _origin.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
|
||||
// Stations require some massaging of the track type for comparing
|
||||
auto comparableTrackType = _trackType;
|
||||
|
@ -253,7 +253,7 @@ public:
|
|||
res->Position.x = _origin.x + 16;
|
||||
res->Position.y = _origin.y + 16;
|
||||
res->Position.z = _origin.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
|
||||
// Stations require some massaging of the track type for comparing
|
||||
auto comparableTrackType = _trackType;
|
||||
|
|
|
@ -57,7 +57,7 @@ private:
|
|||
res->Position = _loc;
|
||||
res->Position.x += 16;
|
||||
res->Position.y += 16;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION;
|
||||
res->Expenditure = ExpenditureType::RideConstruction;
|
||||
|
||||
TileElement* tileElement = map_get_track_element_at_of_type(_loc.x, _loc.y, _loc.z / 8, _trackType);
|
||||
if (tileElement == nullptr)
|
||||
|
|
|
@ -103,7 +103,7 @@ public:
|
|||
res->ErrorTitle = STR_CANT_BUILD_PARK_ENTRANCE_HERE;
|
||||
res->Position = _loc;
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x += 16;
|
||||
res->Position.y += 16;
|
||||
|
||||
|
@ -303,7 +303,7 @@ public:
|
|||
res->ErrorTitle = STR_CANT_BUILD_PARK_ENTRANCE_HERE;
|
||||
res->Position = _loc;
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x += 16;
|
||||
res->Position.y += 16;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->Cost = 0;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
if (!map_is_location_valid(_loc))
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ public:
|
|||
{
|
||||
GameActionResult::Ptr res = std::make_unique<GameActionResult>();
|
||||
res->Cost = 0;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
const bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST;
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !map_is_location_in_park(_loc) && !gCheatsSandboxMode)
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ public:
|
|||
res->Position.x = _loc.x + 16;
|
||||
res->Position.y = _loc.y + 16;
|
||||
res->Position.z = _loc.z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
auto wallElement = map_get_wall_element_at(_loc);
|
||||
if (wallElement == nullptr)
|
||||
|
|
|
@ -70,7 +70,7 @@ private:
|
|||
z = waterHeight;
|
||||
}
|
||||
res->Position.z = z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
uint8_t minHeight = GetLowestHeight(validRange);
|
||||
bool hasChanged = false;
|
||||
|
|
|
@ -71,7 +71,7 @@ private:
|
|||
z = waterHeight;
|
||||
}
|
||||
res->Position.z = z;
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
|
||||
uint8_t maxHeight = GetHighestHeight(validRange);
|
||||
bool hasChanged = false;
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
GameActionResult::Ptr Query() const override
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = _coords.x + 16;
|
||||
res->Position.y = _coords.y + 16;
|
||||
res->Position.z = _height * 8;
|
||||
|
@ -108,7 +108,7 @@ public:
|
|||
GameActionResult::Ptr Execute() const override
|
||||
{
|
||||
auto res = MakeResult();
|
||||
res->ExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
|
||||
res->Expenditure = ExpenditureType::Landscaping;
|
||||
res->Position.x = _coords.x + 16;
|
||||
res->Position.y = _coords.y + 16;
|
||||
res->Position.z = _height * 8;
|
||||
|
|
|
@ -32,7 +32,7 @@ const money32 research_cost_table[RESEARCH_FUNDING_COUNT] = {
|
|||
MONEY(400, 00), // Maximum funding
|
||||
};
|
||||
|
||||
static constexpr const int32_t dword_988E60[RCT_EXPENDITURE_TYPE_COUNT] = {
|
||||
static constexpr const int32_t dword_988E60[static_cast<int32_t>(ExpenditureType::Count)] = {
|
||||
1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0,
|
||||
};
|
||||
|
||||
|
@ -49,7 +49,7 @@ uint16_t gWeeklyProfitAverageDivisor;
|
|||
money32 gCashHistory[FINANCE_GRAPH_SIZE];
|
||||
money32 gWeeklyProfitHistory[FINANCE_GRAPH_SIZE];
|
||||
money32 gParkValueHistory[FINANCE_GRAPH_SIZE];
|
||||
money32 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][RCT_EXPENDITURE_TYPE_COUNT];
|
||||
money32 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast<int32_t>(ExpenditureType::Count)];
|
||||
|
||||
/**
|
||||
* Checks the condition if the game is required to use money.
|
||||
|
@ -84,13 +84,13 @@ bool finance_check_affordability(money32 cost, uint32_t flags)
|
|||
* @param amount (eax)
|
||||
* @param type passed via global var 0x0141F56C (RCT2_ADDRESS_NEXT_EXPENDITURE_TYPE), our type is that var/4.
|
||||
*/
|
||||
void finance_payment(money32 amount, rct_expenditure_type type)
|
||||
void finance_payment(money32 amount, ExpenditureType type)
|
||||
{
|
||||
// overflow check
|
||||
gCash = add_clamp_money32(gCash, -amount);
|
||||
|
||||
gExpenditureTable[0][type] -= amount;
|
||||
if (dword_988E60[type] & 1)
|
||||
gExpenditureTable[0][static_cast<int32_t>(type)] -= amount;
|
||||
if (dword_988E60[static_cast<int32_t>(type)] & 1)
|
||||
{
|
||||
// Cumulative amount of money spent this day
|
||||
gCurrentExpenditure -= amount;
|
||||
|
@ -116,7 +116,7 @@ void finance_pay_wages()
|
|||
|
||||
FOR_ALL_STAFF (spriteIndex, peep)
|
||||
{
|
||||
finance_payment(gStaffWageTable[peep->staff_type] / 4, RCT_EXPENDITURE_TYPE_WAGES);
|
||||
finance_payment(gStaffWageTable[peep->staff_type] / 4, ExpenditureType::Wages);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ void finance_pay_research()
|
|||
}
|
||||
|
||||
level = gResearchFundingLevel;
|
||||
finance_payment(research_cost_table[level] / 4, RCT_EXPENDITURE_TYPE_RESEARCH);
|
||||
finance_payment(research_cost_table[level] / 4, ExpenditureType::Research);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -156,7 +156,7 @@ void finance_pay_interest()
|
|||
|
||||
interest_to_pay = (current_loan * 5 * current_interest_rate) >> 14;
|
||||
|
||||
finance_payment(interest_to_pay, RCT_EXPENDITURE_TYPE_INTEREST);
|
||||
finance_payment(interest_to_pay, ExpenditureType::Interest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -179,7 +179,7 @@ void finance_pay_ride_upkeep()
|
|||
{
|
||||
ride.total_profit -= upkeep;
|
||||
ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
||||
finance_payment(upkeep, RCT_EXPENDITURE_TYPE_RIDE_RUNNING_COSTS);
|
||||
finance_payment(upkeep, ExpenditureType::RideRunningCosts);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ void finance_reset_history()
|
|||
void finance_init()
|
||||
{
|
||||
// It only initialises the first month
|
||||
for (uint32_t i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
for (uint32_t i = 0; i < static_cast<int32_t>(ExpenditureType::Count); i++)
|
||||
{
|
||||
gExpenditureTable[0][i] = 0;
|
||||
}
|
||||
|
@ -318,7 +318,7 @@ void finance_shift_expenditure_table()
|
|||
if (gDateMonthsElapsed >= EXPENDITURE_TABLE_MONTH_COUNT)
|
||||
{
|
||||
money32 sum = 0;
|
||||
for (uint32_t i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
for (uint32_t i = 0; i < static_cast<int32_t>(ExpenditureType::Count); i++)
|
||||
{
|
||||
sum += gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1][i];
|
||||
}
|
||||
|
@ -328,14 +328,14 @@ void finance_shift_expenditure_table()
|
|||
// Shift the table
|
||||
for (size_t i = EXPENDITURE_TABLE_MONTH_COUNT - 1; i >= 1; i--)
|
||||
{
|
||||
for (size_t j = 0; j < RCT_EXPENDITURE_TYPE_COUNT; j++)
|
||||
for (size_t j = 0; j < static_cast<int32_t>(ExpenditureType::Count); j++)
|
||||
{
|
||||
gExpenditureTable[i][j] = gExpenditureTable[i - 1][j];
|
||||
}
|
||||
}
|
||||
|
||||
// Zero the beginning of the table, which is the new month
|
||||
for (uint32_t i = 0; i < RCT_EXPENDITURE_TYPE_COUNT; i++)
|
||||
for (uint32_t i = 0; i < static_cast<int32_t>(ExpenditureType::Count); i++)
|
||||
{
|
||||
gExpenditureTable[0][i] = 0;
|
||||
}
|
||||
|
@ -362,10 +362,10 @@ money32 finance_get_last_month_shop_profit()
|
|||
{
|
||||
money32* lastMonthExpenditure = gExpenditureTable[1];
|
||||
|
||||
profit += lastMonthExpenditure[RCT_EXPENDITURE_TYPE_SHOP_SHOP_SALES];
|
||||
profit += lastMonthExpenditure[RCT_EXPENDITURE_TYPE_SHOP_STOCK];
|
||||
profit += lastMonthExpenditure[RCT_EXPENDITURE_TYPE_FOODDRINK_SALES];
|
||||
profit += lastMonthExpenditure[RCT_EXPENDITURE_TYPE_FOODDRINK_STOCK];
|
||||
profit += lastMonthExpenditure[static_cast<int32_t>(ExpenditureType::ShopSales)];
|
||||
profit += lastMonthExpenditure[static_cast<int32_t>(ExpenditureType::ShopStock)];
|
||||
profit += lastMonthExpenditure[static_cast<int32_t>(ExpenditureType::FoodDrinkSales)];
|
||||
profit += lastMonthExpenditure[static_cast<int32_t>(ExpenditureType::FoodDrinkStock)];
|
||||
}
|
||||
return profit;
|
||||
}
|
||||
|
|
|
@ -12,23 +12,23 @@
|
|||
#include "../common.h"
|
||||
#include "Research.h"
|
||||
|
||||
enum rct_expenditure_type : int32_t
|
||||
enum class ExpenditureType : int32_t
|
||||
{
|
||||
RCT_EXPENDITURE_TYPE_RIDE_CONSTRUCTION = 0,
|
||||
RCT_EXPENDITURE_TYPE_RIDE_RUNNING_COSTS,
|
||||
RCT_EXPENDITURE_TYPE_LAND_PURCHASE,
|
||||
RCT_EXPENDITURE_TYPE_LANDSCAPING,
|
||||
RCT_EXPENDITURE_TYPE_PARK_ENTRANCE_TICKETS,
|
||||
RCT_EXPENDITURE_TYPE_PARK_RIDE_TICKETS,
|
||||
RCT_EXPENDITURE_TYPE_SHOP_SHOP_SALES,
|
||||
RCT_EXPENDITURE_TYPE_SHOP_STOCK,
|
||||
RCT_EXPENDITURE_TYPE_FOODDRINK_SALES,
|
||||
RCT_EXPENDITURE_TYPE_FOODDRINK_STOCK,
|
||||
RCT_EXPENDITURE_TYPE_WAGES,
|
||||
RCT_EXPENDITURE_TYPE_MARKETING,
|
||||
RCT_EXPENDITURE_TYPE_RESEARCH,
|
||||
RCT_EXPENDITURE_TYPE_INTEREST,
|
||||
RCT_EXPENDITURE_TYPE_COUNT
|
||||
RideConstruction = 0,
|
||||
RideRunningCosts,
|
||||
LandPurchase,
|
||||
Landscaping,
|
||||
ParkEntranceTickets,
|
||||
ParkRideTickets,
|
||||
ShopSales,
|
||||
ShopStock,
|
||||
FoodDrinkSales,
|
||||
FoodDrinkStock,
|
||||
Wages,
|
||||
Marketing,
|
||||
Research,
|
||||
Interest,
|
||||
Count
|
||||
};
|
||||
|
||||
#define EXPENDITURE_TABLE_MONTH_COUNT 16
|
||||
|
@ -55,11 +55,11 @@ extern uint16_t gWeeklyProfitAverageDivisor;
|
|||
extern money32 gCashHistory[FINANCE_GRAPH_SIZE];
|
||||
extern money32 gWeeklyProfitHistory[FINANCE_GRAPH_SIZE];
|
||||
extern money32 gParkValueHistory[FINANCE_GRAPH_SIZE];
|
||||
extern money32 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][RCT_EXPENDITURE_TYPE_COUNT];
|
||||
extern money32 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast<int32_t>(ExpenditureType::Count)];
|
||||
|
||||
bool finance_check_money_required(uint32_t flags);
|
||||
bool finance_check_affordability(money32 cost, uint32_t flags);
|
||||
void finance_payment(money32 amount, rct_expenditure_type type);
|
||||
void finance_payment(money32 amount, ExpenditureType type);
|
||||
void finance_pay_wages();
|
||||
void finance_pay_research();
|
||||
void finance_pay_interest();
|
||||
|
|
|
@ -1708,25 +1708,25 @@ loc_69B221:
|
|||
no_of_souvenirs++;
|
||||
|
||||
money16* expend_type = &paid_on_souvenirs;
|
||||
rct_expenditure_type expenditure = RCT_EXPENDITURE_TYPE_SHOP_STOCK;
|
||||
ExpenditureType expenditure = ExpenditureType::ShopStock;
|
||||
|
||||
if (shop_item_is_food(shopItem))
|
||||
{
|
||||
expend_type = &paid_on_food;
|
||||
expenditure = RCT_EXPENDITURE_TYPE_FOODDRINK_STOCK;
|
||||
expenditure = ExpenditureType::FoodDrinkStock;
|
||||
}
|
||||
|
||||
if (shop_item_is_drink(shopItem))
|
||||
{
|
||||
expend_type = &paid_on_drink;
|
||||
expenditure = RCT_EXPENDITURE_TYPE_FOODDRINK_STOCK;
|
||||
expenditure = ExpenditureType::FoodDrinkStock;
|
||||
}
|
||||
|
||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||
finance_payment(ShopItems[shopItem].Cost, expenditure);
|
||||
|
||||
// Sets the expenditure type to *_FOODDRINK_SALES or *_SHOP_SALES appropriately.
|
||||
expenditure = static_cast<rct_expenditure_type>(static_cast<int32_t>(expenditure) - 1);
|
||||
expenditure = static_cast<ExpenditureType>(static_cast<int32_t>(expenditure) - 1);
|
||||
if (hasVoucher)
|
||||
{
|
||||
item_standard_flags &= ~PEEP_ITEM_VOUCHER;
|
||||
|
@ -2330,7 +2330,7 @@ bool Guest::ShouldGoToShop(Ride* ride, bool peepAtShop)
|
|||
}
|
||||
|
||||
// Used when no logging to an expend type required
|
||||
void Guest::SpendMoney(money32 amount, rct_expenditure_type expenditure)
|
||||
void Guest::SpendMoney(money32 amount, ExpenditureType expenditure)
|
||||
{
|
||||
money16 unused;
|
||||
SpendMoney(unused, amount, expenditure);
|
||||
|
@ -2341,7 +2341,7 @@ void Guest::SpendMoney(money32 amount, rct_expenditure_type expenditure)
|
|||
* rct2: 0x0069926C
|
||||
* Expend type was previously an offset saved in 0x00F1AEC0
|
||||
*/
|
||||
void Guest::SpendMoney(money16& peep_expend_type, money32 amount, rct_expenditure_type expenditure)
|
||||
void Guest::SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureType expenditure)
|
||||
{
|
||||
assert(!(gParkFlags & PARK_FLAGS_NO_MONEY));
|
||||
|
||||
|
@ -3873,7 +3873,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride)
|
|||
{
|
||||
ride->total_profit += ridePrice;
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
||||
SpendMoney(paid_on_rides, ridePrice, RCT_EXPENDITURE_TYPE_PARK_RIDE_TICKETS);
|
||||
SpendMoney(paid_on_rides, ridePrice, ExpenditureType::ParkRideTickets);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2623,7 +2623,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
|
|||
}
|
||||
|
||||
gTotalIncomeFromAdmissions += entranceFee;
|
||||
guest->SpendMoney(peep->paid_to_enter, entranceFee, RCT_EXPENDITURE_TYPE_PARK_ENTRANCE_TICKETS);
|
||||
guest->SpendMoney(peep->paid_to_enter, entranceFee, ExpenditureType::ParkEntranceTickets);
|
||||
peep->peep_flags |= PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY;
|
||||
}
|
||||
|
||||
|
@ -2963,7 +2963,7 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen
|
|||
// TODO: Refactor? SpendMoney previously accepted nullptr to not track money, passing a temporary variable as a
|
||||
// workaround
|
||||
money16 money = 0;
|
||||
guest->SpendMoney(money, cost, RCT_EXPENDITURE_TYPE_PARK_RIDE_TICKETS);
|
||||
guest->SpendMoney(money, cost, ExpenditureType::ParkRideTickets);
|
||||
}
|
||||
peep->destination_x = (x & 0xFFE0) + 16;
|
||||
peep->destination_y = (y & 0xFFE0) + 16;
|
||||
|
|
|
@ -763,8 +763,8 @@ public:
|
|||
bool ShouldFindBench();
|
||||
bool UpdateWalkingFindBench();
|
||||
bool UpdateWalkingFindBin();
|
||||
void SpendMoney(money16& peep_expend_type, money32 amount, rct_expenditure_type type);
|
||||
void SpendMoney(money32 amount, rct_expenditure_type type);
|
||||
void SpendMoney(money16& peep_expend_type, money32 amount, ExpenditureType type);
|
||||
void SpendMoney(money32 amount, ExpenditureType type);
|
||||
void SetHasRidden(const Ride* ride);
|
||||
bool HasRidden(const Ride* ride) const;
|
||||
void SetHasRiddenRideType(int32_t rideType);
|
||||
|
|
|
@ -838,7 +838,7 @@ static void scenario_objective_check_guests_and_rating()
|
|||
|
||||
static void scenario_objective_check_monthly_ride_income()
|
||||
{
|
||||
money32 lastMonthRideIncome = gExpenditureTable[1][RCT_EXPENDITURE_TYPE_PARK_RIDE_TICKETS];
|
||||
money32 lastMonthRideIncome = gExpenditureTable[1][static_cast<int32_t>(ExpenditureType::ParkRideTickets)];
|
||||
if (lastMonthRideIncome >= gScenarioObjectiveCurrency)
|
||||
{
|
||||
scenario_success();
|
||||
|
@ -920,9 +920,10 @@ static void scenario_objective_check_replay_loan_and_park_value()
|
|||
static void scenario_objective_check_monthly_food_income()
|
||||
{
|
||||
money32* lastMonthExpenditure = gExpenditureTable[1];
|
||||
int32_t lastMonthProfit = lastMonthExpenditure[RCT_EXPENDITURE_TYPE_SHOP_SHOP_SALES]
|
||||
+ lastMonthExpenditure[RCT_EXPENDITURE_TYPE_SHOP_STOCK] + lastMonthExpenditure[RCT_EXPENDITURE_TYPE_FOODDRINK_SALES]
|
||||
+ lastMonthExpenditure[RCT_EXPENDITURE_TYPE_FOODDRINK_STOCK];
|
||||
int32_t lastMonthProfit = lastMonthExpenditure[static_cast<int32_t>(ExpenditureType::ShopSales)]
|
||||
+ lastMonthExpenditure[static_cast<int32_t>(ExpenditureType::ShopStock)]
|
||||
+ lastMonthExpenditure[static_cast<int32_t>(ExpenditureType::FoodDrinkSales)]
|
||||
+ lastMonthExpenditure[static_cast<int32_t>(ExpenditureType::FoodDrinkStock)];
|
||||
|
||||
if (lastMonthProfit >= gScenarioObjectiveCurrency)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue