From 4f9227fd83a93a6dd5b98ab4a0e3aed48491e3cc Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Mon, 8 Jun 2020 22:55:07 -0300 Subject: [PATCH] Rename Peep::intensity to Intensity --- src/openrct2-ui/windows/Guest.cpp | 6 +++--- src/openrct2/GameStateSnapshots.cpp | 2 +- src/openrct2/actions/SetCheatAction.hpp | 2 +- src/openrct2/peep/Guest.cpp | 14 +++++++------- src/openrct2/peep/Peep.cpp | 2 +- src/openrct2/peep/Peep.h | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Exporter.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/scripting/ScEntity.hpp | 8 ++++---- test/tests/S6ImportExportTests.cpp | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 72ed910a07..779f37b8b6 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1532,11 +1532,11 @@ void window_guest_stats_paint(rct_window* w, rct_drawpixelinfo* dpi) // Intensity auto ft = Formatter::Common(); - auto maxIntensity = peep->intensity.GetMaximum(); + auto maxIntensity = peep->Intensity.GetMaximum(); int32_t string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BELOW; - if (peep->intensity.GetMinimum() != 0) + if (peep->Intensity.GetMinimum() != 0) { - ft.Add(peep->intensity.GetMinimum()); + ft.Add(peep->Intensity.GetMinimum()); ft.Add(maxIntensity); string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BETWEEN; if (maxIntensity == 15) diff --git a/src/openrct2/GameStateSnapshots.cpp b/src/openrct2/GameStateSnapshots.cpp index 82aa92b9fc..e7d7e969d0 100644 --- a/src/openrct2/GameStateSnapshots.cpp +++ b/src/openrct2/GameStateSnapshots.cpp @@ -238,7 +238,7 @@ struct GameStateSnapshots final : public IGameStateSnapshots COMPARE_FIELD(Peep, toilet); COMPARE_FIELD(Peep, mass); COMPARE_FIELD(Peep, time_to_consume); - COMPARE_FIELD(Peep, intensity); + COMPARE_FIELD(Peep, Intensity); COMPARE_FIELD(Peep, NauseaTolerance); COMPARE_FIELD(Peep, WindowInvalidateFlags); COMPARE_FIELD(Peep, PaidOnDrink); diff --git a/src/openrct2/actions/SetCheatAction.hpp b/src/openrct2/actions/SetCheatAction.hpp index 24c7c2492d..de75891b9a 100644 --- a/src/openrct2/actions/SetCheatAction.hpp +++ b/src/openrct2/actions/SetCheatAction.hpp @@ -614,7 +614,7 @@ private: peep->toilet = value; break; case GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY: - peep->intensity = IntensityRange(value, 15); + peep->Intensity = IntensityRange(value, 15); break; } peep->UpdateSpriteType(); diff --git a/src/openrct2/peep/Guest.cpp b/src/openrct2/peep/Guest.cpp index a3948fc195..a300874dca 100644 --- a/src/openrct2/peep/Guest.cpp +++ b/src/openrct2/peep/Guest.cpp @@ -1807,9 +1807,9 @@ void Guest::OnExitRide(ride_id_t rideIndex) if (peep_should_preferred_intensity_increase(this)) { - if (intensity.GetMaximum() < 15) + if (Intensity.GetMaximum() < 15) { - intensity = intensity.WithMaximum(intensity.GetMaximum() + 1); + Intensity = Intensity.WithMaximum(Intensity.GetMaximum() + 1); } } @@ -2123,8 +2123,8 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t // Intensity calculations. Even though the max intensity can go up to 15, it's capped // at 10.0 (before happiness calculations). A full happiness bar will increase the max // intensity and decrease the min intensity by about 2.5. - ride_rating maxIntensity = std::min(intensity.GetMaximum() * 100, 1000) + happiness; - ride_rating minIntensity = (intensity.GetMinimum() * 100) - happiness; + ride_rating maxIntensity = std::min(Intensity.GetMaximum() * 100, 1000) + happiness; + ride_rating minIntensity = (Intensity.GetMinimum() * 100) - happiness; if (ride->intensity < minIntensity) { if (peepAtRide) @@ -2764,8 +2764,8 @@ static int16_t peep_calculate_ride_intensity_nausea_satisfaction(Peep* peep, Rid uint8_t intensitySatisfaction = 3; uint8_t nauseaSatisfaction = 3; - ride_rating maxIntensity = peep->intensity.GetMaximum() * 100; - ride_rating minIntensity = peep->intensity.GetMinimum() * 100; + ride_rating maxIntensity = peep->Intensity.GetMaximum() * 100; + ride_rating minIntensity = peep->Intensity.GetMinimum() * 100; if (minIntensity <= ride->intensity && maxIntensity >= ride->intensity) { intensitySatisfaction--; @@ -2904,7 +2904,7 @@ static bool peep_should_preferred_intensity_increase(Peep* peep) if (peep->happiness < 200) return false; - return (scenario_rand() & 0xFF) >= static_cast(peep->intensity); + return (scenario_rand() & 0xFF) >= static_cast(peep->Intensity); } static bool peep_really_liked_ride(Peep* peep, Ride* ride) diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index a486b1e439..835ef4d446 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -1669,7 +1669,7 @@ Peep* Peep::Generate(const CoordsXYZ& coords) intensityHighest = 15; } - peep->intensity = IntensityRange(intensityLowest, intensityHighest); + peep->Intensity = IntensityRange(intensityLowest, intensityHighest); uint8_t nauseaTolerance = scenario_rand() & 0x7; if (gParkFlags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES) diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index bc4fe9430a..488b95035f 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -626,7 +626,7 @@ struct Peep : SpriteBase uint8_t toilet; uint8_t mass; uint8_t time_to_consume; - IntensityRange intensity; + IntensityRange Intensity; uint8_t NauseaTolerance; uint8_t WindowInvalidateFlags; money16 PaidOnDrink; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index b4b7a62395..870227c4d2 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1462,7 +1462,7 @@ private: dst->LitterCount = src->litter_count; dst->DisgustingCount = src->disgusting_count; - dst->intensity = static_cast(src->intensity); + dst->Intensity = static_cast(src->intensity); dst->NauseaTolerance = src->nausea_tolerance; dst->WindowInvalidateFlags = 0; diff --git a/src/openrct2/rct2/S6Exporter.cpp b/src/openrct2/rct2/S6Exporter.cpp index 03802d53f5..8b2814d973 100644 --- a/src/openrct2/rct2/S6Exporter.cpp +++ b/src/openrct2/rct2/S6Exporter.cpp @@ -1160,7 +1160,7 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src) dst->toilet = src->toilet; dst->mass = src->mass; dst->time_to_consume = src->time_to_consume; - dst->intensity = static_cast(src->intensity); + dst->intensity = static_cast(src->Intensity); dst->nausea_tolerance = src->NauseaTolerance; dst->window_invalidate_flags = src->WindowInvalidateFlags; dst->paid_on_drink = src->PaidOnDrink; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 98199d89c9..6844abe4c1 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1425,7 +1425,7 @@ public: dst->toilet = src->toilet; dst->mass = src->mass; dst->time_to_consume = src->time_to_consume; - dst->intensity = static_cast(src->intensity); + dst->Intensity = static_cast(src->intensity); dst->NauseaTolerance = src->nausea_tolerance; dst->WindowInvalidateFlags = src->window_invalidate_flags; dst->PaidOnDrink = src->paid_on_drink; diff --git a/src/openrct2/scripting/ScEntity.hpp b/src/openrct2/scripting/ScEntity.hpp index 8a1b3619d0..244010ba34 100644 --- a/src/openrct2/scripting/ScEntity.hpp +++ b/src/openrct2/scripting/ScEntity.hpp @@ -581,7 +581,7 @@ namespace OpenRCT2::Scripting uint8_t minIntensity_get() const { auto peep = GetPeep(); - return peep != nullptr ? peep->intensity.GetMinimum() : 0; + return peep != nullptr ? peep->Intensity.GetMinimum() : 0; } void minIntensity_set(uint8_t value) { @@ -589,14 +589,14 @@ namespace OpenRCT2::Scripting auto peep = GetPeep(); if (peep != nullptr) { - peep->intensity = peep->intensity.WithMinimum(value); + peep->Intensity = peep->Intensity.WithMinimum(value); } } uint8_t maxIntensity_get() const { auto peep = GetPeep(); - return peep != nullptr ? peep->intensity.GetMaximum() : 0; + return peep != nullptr ? peep->Intensity.GetMaximum() : 0; } void maxIntensity_set(uint8_t value) { @@ -604,7 +604,7 @@ namespace OpenRCT2::Scripting auto peep = GetPeep(); if (peep != nullptr) { - peep->intensity = peep->intensity.WithMaximum(value); + peep->Intensity = peep->Intensity.WithMaximum(value); } } diff --git a/test/tests/S6ImportExportTests.cpp b/test/tests/S6ImportExportTests.cpp index 53ab4d94de..a73e1b4d1b 100644 --- a/test/tests/S6ImportExportTests.cpp +++ b/test/tests/S6ImportExportTests.cpp @@ -182,7 +182,7 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right) COMPARE_FIELD(toilet); COMPARE_FIELD(mass); COMPARE_FIELD(time_to_consume); - COMPARE_FIELD(intensity); + COMPARE_FIELD(Intensity); COMPARE_FIELD(NauseaTolerance); COMPARE_FIELD(WindowInvalidateFlags); COMPARE_FIELD(PaidOnDrink);