Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)

This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
This commit is contained in:
Peter Nelson
2023-11-06 20:29:35 +00:00
committed by GitHub
parent 737775f834
commit ab535c0a86
73 changed files with 174 additions and 173 deletions

View File

@@ -277,7 +277,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(byte local_id, uint32_t grf
break;
/* Construction date */
case 0x42: return static_cast<int32_t>(TimerGameCalendar::date);
case 0x42: return TimerGameCalendar::date.base();
/* Object founder information */
case 0x44: return _current_company;
@@ -315,7 +315,7 @@ static uint32_t GetCountAndDistanceOfClosestInstance(byte local_id, uint32_t grf
case 0x41: return GetTileSlope(this->tile) << 8 | GetTerrainType(this->tile);
/* Construction date */
case 0x42: return static_cast<int32_t>(this->obj->build_date);
case 0x42: return this->obj->build_date.base();
/* Animation counter */
case 0x43: return GetAnimationFrame(this->tile);