1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Refactor ResearchItem Type to an enum class (#12346)

* Change type of ResearchItem.type to enum class

This is to prevent any future issues caused by confusion as to what the type is and further improves the codebase.

* Specifiy a size for the type

Also remove the static cast where not required

* Apply review comments
This commit is contained in:
Duncan
2020-07-22 14:25:05 +01:00
committed by GitHub
parent 4416565e47
commit 4a235e3bb6
8 changed files with 38 additions and 34 deletions

View File

@@ -296,7 +296,7 @@ static void remove_selected_objects_from_research(const rct_object_entry* instal
for (auto rideType : rideEntry->ride_type)
{
ResearchItem tmp = {};
tmp.type = RESEARCH_ENTRY_TYPE_RIDE;
tmp.type = Research::EntryType::Ride;
tmp.entryIndex = entry_index;
tmp.baseRideType = rideType;
research_remove(&tmp);
@@ -305,7 +305,7 @@ static void remove_selected_objects_from_research(const rct_object_entry* instal
else if (entry_type == OBJECT_TYPE_SCENERY_GROUP)
{
ResearchItem tmp = {};
tmp.type = RESEARCH_ENTRY_TYPE_SCENERY;
tmp.type = Research::EntryType::Scenery;
tmp.entryIndex = entry_index;
research_remove(&tmp);
}