Skip to content

Commit

Permalink
Rename TileElement::ElementType to TileElement::kElementType
Browse files Browse the repository at this point in the history
  • Loading branch information
Gymnasiast committed Oct 19, 2024
1 parent e2a5f98 commit 2f7d5ff
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/openrct2/world/Map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/world/tile_element/BannerElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/world/tile_element/EntranceElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/world/tile_element/LargeSceneryElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/world/tile_element/PathElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/world/tile_element/SmallSceneryElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/world/tile_element/SurfaceElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/openrct2/world/tile_element/TileElementBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ 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()
{
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;
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/world/tile_element/TrackElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ enum

struct TrackElement : TileElementBase
{
static constexpr TileElementType ElementType = TileElementType::Track;
static constexpr TileElementType kElementType = TileElementType::Track;

private:
OpenRCT2::TrackElemType TrackType;
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2/world/tile_element/WallElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2f7d5ff

Please sign in to comment.