Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761)

This commit is contained in:
Patric Stout
2023-08-12 20:14:21 +02:00
committed by GitHub
parent 0238a2b567
commit 299570b2c1
55 changed files with 390 additions and 203 deletions

View File

@@ -30,7 +30,7 @@
case 0x40: return 0;
case 0x41: return 0;
case 0x42: return 0;
case 0x43: return TimerGameCalendar::date;
case 0x43: return static_cast<int32_t>(TimerGameCalendar::date);
case 0x44: return HZB_TOWN_EDGE;
}
}
@@ -40,8 +40,8 @@
case 0x41: return 0;
case 0x42: return IsLevelCrossingTile(this->tile) && IsCrossingBarred(this->tile);
case 0x43:
if (IsRailDepotTile(this->tile)) return Depot::GetByTile(this->tile)->build_date;
return TimerGameCalendar::date;
if (IsRailDepotTile(this->tile)) return static_cast<int32_t>(Depot::GetByTile(this->tile)->build_date);
return static_cast<int32_t>(TimerGameCalendar::date);
case 0x44: {
const Town *t = nullptr;
if (IsRailDepotTile(this->tile)) {