Change last usage of GetType() and remove the method

This commit is contained in:
Gymnasiast 2021-12-11 00:38:42 +01:00
parent fc3ce3294c
commit 23c5988fb1
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
3 changed files with 3 additions and 22 deletions

View File

@ -2263,9 +2263,9 @@ uint16_t check_max_allowable_land_rights_for_tile(const CoordsXYZ& tileMapPos)
auto tilePos = TileCoordsXYZ{ tileMapPos };
do
{
int32_t type = tileElement->GetType();
if (type == TILE_ELEMENT_TYPE_PATH
|| (type == TILE_ELEMENT_TYPE_ENTRANCE
auto type = tileElement->GetTypeN();
if (type == TileElementTypeN::Path
|| (type == TileElementTypeN::Entrance
&& tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE))
{
destOwnership = OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED;

View File

@ -36,18 +36,6 @@ constexpr const uint8_t OWNER_MASK = 0b00001111;
#pragma pack(push, 1)
enum
{
TILE_ELEMENT_TYPE_SURFACE = (0 << 2),
TILE_ELEMENT_TYPE_PATH = (1 << 2),
TILE_ELEMENT_TYPE_TRACK = (2 << 2),
TILE_ELEMENT_TYPE_SMALL_SCENERY = (3 << 2),
TILE_ELEMENT_TYPE_ENTRANCE = (4 << 2),
TILE_ELEMENT_TYPE_WALL = (5 << 2),
TILE_ELEMENT_TYPE_LARGE_SCENERY = (6 << 2),
TILE_ELEMENT_TYPE_BANNER = (7 << 2),
};
enum class TileElementTypeN : uint8_t
{
Surface = 0,
@ -80,8 +68,6 @@ struct TileElementBase
void Remove();
uint8_t GetType() const;
TileElementTypeN GetTypeN() const;
void SetTypeN(TileElementTypeN newType);

View File

@ -10,11 +10,6 @@
#include "Map.h"
#include "TileElement.h"
uint8_t TileElementBase::GetType() const
{
return this->type & TILE_ELEMENT_TYPE_MASK;
}
TileElementTypeN TileElementBase::GetTypeN() const
{
return static_cast<TileElementTypeN>((this->type & TILE_ELEMENT_TYPE_MASK) >> 2);