mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 11:33:03 +01:00
Rename Object and TileElement type constant (#23030)
* Rename Object::objectType to Object::kObjectType * Rename TileElement::ElementType to TileElement::kElementType
This commit is contained in:
committed by
GitHub
parent
f0c353254f
commit
8fe2d7de1f
@@ -23,7 +23,7 @@ private:
|
||||
AudioSampleTable _loadedSampleTable;
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::Audio;
|
||||
static constexpr ObjectType kObjectType = ObjectType::Audio;
|
||||
|
||||
void ReadJson(IReadObjectContext* context, json_t& root) override;
|
||||
void Load() override;
|
||||
|
||||
@@ -19,7 +19,7 @@ private:
|
||||
BannerSceneryEntry _legacyType = {};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::Banners;
|
||||
static constexpr ObjectType kObjectType = ObjectType::Banners;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ private:
|
||||
EntranceEntry _legacyType = {};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::ParkEntrance;
|
||||
static constexpr ObjectType kObjectType = ObjectType::ParkEntrance;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ private:
|
||||
PathRailingsDescriptor _pathRailingsDescriptor = {};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::Paths;
|
||||
static constexpr ObjectType kObjectType = ObjectType::Paths;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
PathRailingsDescriptor _descriptor = {};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::FootpathRailings;
|
||||
static constexpr ObjectType kObjectType = ObjectType::FootpathRailings;
|
||||
|
||||
void ReadJson(IReadObjectContext* context, json_t& root) override;
|
||||
void Load() override;
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
PathSurfaceDescriptor _descriptor = {};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::FootpathSurface;
|
||||
static constexpr ObjectType kObjectType = ObjectType::FootpathSurface;
|
||||
|
||||
void ReadJson(IReadObjectContext* context, json_t& root) override;
|
||||
void Load() override;
|
||||
|
||||
@@ -24,7 +24,7 @@ private:
|
||||
std::unique_ptr<LargeSceneryText> _3dFont;
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::LargeScenery;
|
||||
static constexpr ObjectType kObjectType = ObjectType::LargeScenery;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
uint32_t _previewImageId{};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::Music;
|
||||
static constexpr ObjectType kObjectType = ObjectType::Music;
|
||||
|
||||
StringId NameStringId{};
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ struct IObjectManager
|
||||
virtual Object* GetLoadedObject(ObjectType objectType, size_t index) = 0;
|
||||
template<typename TClass> TClass* GetLoadedObject(size_t index)
|
||||
{
|
||||
return static_cast<TClass*>(GetLoadedObject(TClass::objectType, index));
|
||||
return static_cast<TClass*>(GetLoadedObject(TClass::kObjectType, index));
|
||||
}
|
||||
virtual Object* GetLoadedObject(const ObjectEntryDescriptor& entry) = 0;
|
||||
virtual ObjectEntryIndex GetLoadedObjectEntryIndex(std::string_view identifier) = 0;
|
||||
|
||||
@@ -18,7 +18,7 @@ private:
|
||||
PathAdditionEntry _legacyType = {};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::PathAdditions;
|
||||
static constexpr ObjectType kObjectType = ObjectType::PathAdditions;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ private:
|
||||
std::vector<std::string> _surnames;
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::PeepNames;
|
||||
static constexpr ObjectType kObjectType = ObjectType::PeepNames;
|
||||
|
||||
void ReadJson(IReadObjectContext* context, json_t& root) override;
|
||||
void Load() override;
|
||||
|
||||
@@ -26,7 +26,7 @@ private:
|
||||
std::vector<std::array<CoordsXY, 3>> _peepLoadingWaypoints[OpenRCT2::RCT2::ObjectLimits::MaxCarTypesPerRideEntry];
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::Ride;
|
||||
static constexpr ObjectType kObjectType = ObjectType::Ride;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ private:
|
||||
std::vector<ObjectEntryDescriptor> _items;
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::SceneryGroup;
|
||||
static constexpr ObjectType kObjectType = ObjectType::SceneryGroup;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ private:
|
||||
std::vector<uint8_t> _frameOffsets;
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::SmallScenery;
|
||||
static constexpr ObjectType kObjectType = ObjectType::SmallScenery;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRCT2::STATION_OBJECT_FLAGS
|
||||
class StationObject final : public Object
|
||||
{
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::Station;
|
||||
static constexpr ObjectType kObjectType = ObjectType::Station;
|
||||
|
||||
StringId NameStringId{};
|
||||
ImageIndex BaseImageId = ImageIndexUndefined;
|
||||
|
||||
@@ -15,7 +15,7 @@ class TerrainEdgeObject final : public Object
|
||||
{
|
||||
private:
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::TerrainEdge;
|
||||
static constexpr ObjectType kObjectType = ObjectType::TerrainEdge;
|
||||
|
||||
StringId NameStringId{};
|
||||
uint32_t IconImageId{};
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
static constexpr auto kNumImagesInEntry = 19;
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::TerrainSurface;
|
||||
static constexpr ObjectType kObjectType = ObjectType::TerrainSurface;
|
||||
|
||||
static constexpr uint8_t kNoValue = 0xFF;
|
||||
StringId NameStringId{};
|
||||
|
||||
@@ -18,7 +18,7 @@ private:
|
||||
WallSceneryEntry _legacyType = {};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::Walls;
|
||||
static constexpr ObjectType kObjectType = ObjectType::Walls;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ private:
|
||||
WaterObjectEntry _legacyType = {};
|
||||
|
||||
public:
|
||||
static constexpr ObjectType objectType = ObjectType::Water;
|
||||
static constexpr ObjectType kObjectType = ObjectType::Water;
|
||||
|
||||
void* GetLegacyData() override
|
||||
{
|
||||
|
||||
@@ -183,13 +183,13 @@ TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants,
|
||||
|
||||
template<typename T = TileElement> T* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRangedZ& loc)
|
||||
{
|
||||
auto* element = MapGetFirstTileElementWithBaseHeightBetween(loc, T::ElementType);
|
||||
auto* element = MapGetFirstTileElementWithBaseHeightBetween(loc, T::kElementType);
|
||||
return element != nullptr ? element->template as<T>() : nullptr;
|
||||
}
|
||||
|
||||
template<typename T> T* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants)
|
||||
{
|
||||
auto* element = TileElementInsert(loc, occupiedQuadrants, T::ElementType);
|
||||
auto* element = TileElementInsert(loc, occupiedQuadrants, T::kElementType);
|
||||
return (element != nullptr) ? element->template as<T>() : nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ struct BannerSceneryEntry;
|
||||
#pragma pack(push, 1)
|
||||
struct BannerElement : TileElementBase
|
||||
{
|
||||
static constexpr TileElementType ElementType = TileElementType::Banner;
|
||||
static constexpr TileElementType kElementType = TileElementType::Banner;
|
||||
|
||||
private:
|
||||
BannerIndex index; // 5
|
||||
|
||||
@@ -42,7 +42,7 @@ struct EntranceElement;
|
||||
|
||||
struct EntranceElement : TileElementBase
|
||||
{
|
||||
static constexpr TileElementType ElementType = TileElementType::Entrance;
|
||||
static constexpr TileElementType kElementType = TileElementType::Entrance;
|
||||
|
||||
private:
|
||||
uint8_t entranceType; // 5
|
||||
|
||||
@@ -24,7 +24,7 @@ enum
|
||||
#pragma pack(push, 1)
|
||||
struct LargeSceneryElement : TileElementBase
|
||||
{
|
||||
static constexpr TileElementType ElementType = TileElementType::LargeScenery;
|
||||
static constexpr TileElementType kElementType = TileElementType::LargeScenery;
|
||||
|
||||
private:
|
||||
ObjectEntryIndex EntryIndex;
|
||||
|
||||
@@ -59,7 +59,7 @@ enum
|
||||
#pragma pack(push, 1)
|
||||
struct PathElement : TileElementBase
|
||||
{
|
||||
static constexpr TileElementType ElementType = TileElementType::Path;
|
||||
static constexpr TileElementType kElementType = TileElementType::Path;
|
||||
|
||||
private:
|
||||
ObjectEntryIndex SurfaceIndex; // 5
|
||||
|
||||
@@ -22,7 +22,7 @@ enum
|
||||
#pragma pack(push, 1)
|
||||
struct SmallSceneryElement : TileElementBase
|
||||
{
|
||||
static constexpr TileElementType ElementType = TileElementType::SmallScenery;
|
||||
static constexpr TileElementType kElementType = TileElementType::SmallScenery;
|
||||
|
||||
private:
|
||||
ObjectEntryIndex entryIndex; // 5
|
||||
|
||||
@@ -44,7 +44,7 @@ constexpr uint8_t kTileElementSurfaceParkFenceMask = 0x0F;
|
||||
#pragma pack(push, 1)
|
||||
struct SurfaceElement : TileElementBase
|
||||
{
|
||||
static constexpr TileElementType ElementType = TileElementType::Surface;
|
||||
static constexpr TileElementType kElementType = TileElementType::Surface;
|
||||
|
||||
private:
|
||||
uint8_t Slope;
|
||||
|
||||
@@ -89,7 +89,7 @@ struct TileElementBase
|
||||
if constexpr (std::is_same_v<TType, TileElement>)
|
||||
return reinterpret_cast<const TileElement*>(this);
|
||||
else
|
||||
return GetType() == TType::ElementType ? reinterpret_cast<const TType*>(this) : nullptr;
|
||||
return GetType() == TType::kElementType ? reinterpret_cast<const TType*>(this) : nullptr;
|
||||
}
|
||||
|
||||
template<typename TType> TType* as()
|
||||
@@ -97,7 +97,7 @@ struct TileElementBase
|
||||
if constexpr (std::is_same_v<TType, TileElement>)
|
||||
return reinterpret_cast<TileElement*>(this);
|
||||
else
|
||||
return GetType() == TType::ElementType ? reinterpret_cast<TType*>(this) : nullptr;
|
||||
return GetType() == TType::kElementType ? reinterpret_cast<TType*>(this) : nullptr;
|
||||
}
|
||||
|
||||
const SurfaceElement* AsSurface() const;
|
||||
|
||||
@@ -52,7 +52,7 @@ enum
|
||||
|
||||
struct TrackElement : TileElementBase
|
||||
{
|
||||
static constexpr TileElementType ElementType = TileElementType::Track;
|
||||
static constexpr TileElementType kElementType = TileElementType::Track;
|
||||
|
||||
private:
|
||||
OpenRCT2::TrackElemType TrackType;
|
||||
|
||||
@@ -29,7 +29,7 @@ enum
|
||||
#pragma pack(push, 1)
|
||||
struct WallElement : TileElementBase
|
||||
{
|
||||
static constexpr TileElementType ElementType = TileElementType::Wall;
|
||||
static constexpr TileElementType kElementType = TileElementType::Wall;
|
||||
|
||||
private:
|
||||
ObjectEntryIndex entryIndex; // 05
|
||||
|
||||
Reference in New Issue
Block a user