refactor: ObjectType to use strong enum

enum renaming complete
This commit is contained in:
Łukasz Pękalski committed 2020-11-11 16:07:01 +01:00
1 parent 1ab3f4b250
commit 6e5105ab3b
40 files changed
+255 -255

No files matched your search

+5 -5
View File
@@ -148,7 +148,7 @@ protected:
switch (item.ObjectEntry.GetType())
{
case OBJECT_TYPE_RIDE:
case ObjectType::Ride:
stream->WriteValue<uint8_t>(item.RideInfo.RideFlags);
for (int32_t i = 0; i < MAX_CATEGORIES_PER_RIDE; i++)
{
@@ -159,7 +159,7 @@ protected:
stream->WriteValue<uint8_t>(item.RideInfo.RideType[i]);
}
break;
case OBJECT_TYPE_SCENERY_GROUP:
case ObjectType::SceneryGroup:
stream->WriteValue<uint16_t>(static_cast<uint16_t>(item.SceneryGroupInfo.Entries.size()));
for (const auto& entry : item.SceneryGroupInfo.Entries)
{
@@ -194,7 +194,7 @@ protected:
switch (item.ObjectEntry.GetType())
{
case OBJECT_TYPE_RIDE:
case ObjectType::Ride:
item.RideInfo.RideFlags = stream->ReadValue<uint8_t>();
for (int32_t i = 0; i < MAX_CATEGORIES_PER_RIDE; i++)
{
@@ -205,7 +205,7 @@ protected:
item.RideInfo.RideType[i] = stream->ReadValue<uint8_t>();
}
break;
case OBJECT_TYPE_SCENERY_GROUP:
case ObjectType::SceneryGroup:
{
auto numEntries = stream->ReadValue<uint16_t>();
item.SceneryGroupInfo.Entries = std::vector<rct_object_entry>(numEntries);
@@ -689,7 +689,7 @@ bool IsObjectCustom(const ObjectRepositoryItem* object)
// Do not count our new object types as custom yet, otherwise the game
// will try to pack them into saved games.
auto type = object->ObjectEntry.GetType();
if (type > OBJECT_TYPE_SCENARIO_TEXT)
if (type > ObjectType::ScenarioText)
{
return false;
}