mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Add converter from RideCategory to ResearchCategory
This commit is contained in:
@@ -1087,7 +1087,7 @@ static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& ar
|
||||
rideType = rideEntry->ride_type[j];
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = static_cast<ResearchCategory>(RideTypeDescriptors[rideType].Category);
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, groupIndex, category, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +469,7 @@ void research_populate_list_random()
|
||||
{
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = static_cast<ResearchCategory>(RideTypeDescriptors[rideType].Category);
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, i, category, researched);
|
||||
}
|
||||
}
|
||||
@@ -508,7 +508,7 @@ void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched)
|
||||
{
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = static_cast<ResearchCategory>(RideTypeDescriptors[rideType].Category);
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, entryIndex, category, researched);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2632,7 +2632,7 @@ private:
|
||||
dst->baseRideType = rideType;
|
||||
dst->type = Research::EntryType::Ride;
|
||||
dst->flags = 0;
|
||||
dst->category = static_cast<ResearchCategory>(RideTypeDescriptors[rideType].Category);
|
||||
dst->category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2651,7 +2651,7 @@ private:
|
||||
dst->baseRideType = rideType;
|
||||
dst->type = Research::EntryType::Ride;
|
||||
dst->flags = 0;
|
||||
dst->category = static_cast<ResearchCategory>(RideTypeDescriptors[rideType].Category);
|
||||
dst->category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "../audio/audio.h"
|
||||
#include "../interface/Colour.h"
|
||||
#include "../localisation/Localisation.h"
|
||||
#include "../management/Research.h"
|
||||
#include "../sprites.h"
|
||||
#include "Ride.h"
|
||||
#include "ShopItem.h"
|
||||
@@ -329,3 +330,26 @@ bool RideTypeDescriptor::SupportsTrackPiece(const uint64_t trackPiece) const
|
||||
{
|
||||
return GetAvailableTrackPieces() & (1ULL << trackPiece);
|
||||
}
|
||||
|
||||
ResearchCategory RideTypeDescriptor::GetResearchCategory() const
|
||||
{
|
||||
switch (Category)
|
||||
{
|
||||
case RIDE_CATEGORY_TRANSPORT:
|
||||
return ResearchCategory::Transport;
|
||||
case RIDE_CATEGORY_GENTLE:
|
||||
return ResearchCategory::Gentle;
|
||||
case RIDE_CATEGORY_ROLLERCOASTER:
|
||||
return ResearchCategory::Rollercoaster;
|
||||
case RIDE_CATEGORY_THRILL:
|
||||
return ResearchCategory::Thrill;
|
||||
case RIDE_CATEGORY_WATER:
|
||||
return ResearchCategory::Water;
|
||||
case RIDE_CATEGORY_SHOP:
|
||||
return ResearchCategory::Shop;
|
||||
case RIDE_CATEGORY_NONE:
|
||||
break;
|
||||
}
|
||||
log_error("Cannot get Research Category of invalid RideCategory");
|
||||
return ResearchCategory::Transport;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include "Track.h"
|
||||
#include "TrackPaint.h"
|
||||
|
||||
enum class ResearchCategory : uint8_t;
|
||||
|
||||
using ride_ratings_calculation = void (*)(Ride* ride);
|
||||
struct RideComponentName
|
||||
{
|
||||
@@ -176,6 +178,7 @@ struct RideTypeDescriptor
|
||||
bool HasFlag(uint64_t flag) const;
|
||||
uint64_t GetAvailableTrackPieces() const;
|
||||
bool SupportsTrackPiece(const uint64_t trackPiece) const;
|
||||
ResearchCategory GetResearchCategory() const;
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user