Strong typedef: Use strong typedefs for date, date tick, minutes types

Add delta types
Adjust/add type conversion functions
Add various utility methods on types
Remove the various minute macros
Fix some minute conversion inconsistencies
This commit is contained in:
Jonathan G Rennison
2023-12-19 01:03:18 +00:00
parent 1e7b56e13a
commit 03e0ec8276
80 changed files with 538 additions and 431 deletions

View File

@@ -317,8 +317,8 @@ public:
/* Related to age and service time */
Year build_year; ///< Year the vehicle has been built.
Date age; ///< Age in days
Date max_age; ///< Maximum age
DateDelta age; ///< Age in days
DateDelta max_age; ///< Maximum age
Date date_of_last_service; ///< Last date the vehicle had a service at a depot.
Date date_of_last_service_newgrf; ///< Last date the vehicle had a service at a depot, unchanged by the date cheat to protect against unsafe NewGRF behavior.
uint16 reliability; ///< Reliability.
@@ -1536,6 +1536,6 @@ void ClearVehicleTickCaches();
void RemoveFromOtherVehicleTickCache(const Vehicle *v);
void UpdateAllVehiclesIsDrawn();
void ShiftVehicleDates(int interval);
void ShiftVehicleDates(DateDelta interval);
#endif /* VEHICLE_BASE_H */