Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "gfx_type.h"
|
||||
#include "core/bitmath_func.hpp"
|
||||
#include "core/span_type.hpp"
|
||||
#include "core/strong_typedef_type.hpp"
|
||||
#include "vehicle_type.h"
|
||||
|
||||
/**
|
||||
@@ -82,6 +83,18 @@ void SetDParam(size_t n, uint64_t v);
|
||||
void SetDParamMaxValue(size_t n, uint64_t max_value, uint min_count = 0, FontSize size = FS_NORMAL);
|
||||
void SetDParamMaxDigits(size_t n, uint count, FontSize size = FS_NORMAL);
|
||||
|
||||
template <typename T, std::enable_if_t<std::is_base_of<StrongTypedefBase, T>::value, int> = 0>
|
||||
void SetDParam(size_t n, T v)
|
||||
{
|
||||
SetDParam(n, static_cast<typename T::BaseType>(v));
|
||||
}
|
||||
|
||||
template <typename T, std::enable_if_t<std::is_base_of<StrongTypedefBase, T>::value, int> = 0>
|
||||
void SetDParamMaxValue(size_t n, T max_value, uint min_count = 0, FontSize size = FS_NORMAL)
|
||||
{
|
||||
SetDParamMaxValue(n, static_cast<typename T::BaseType>(max_value), min_count, size);
|
||||
}
|
||||
|
||||
void SetDParamStr(size_t n, const char *str);
|
||||
void SetDParamStr(size_t n, const std::string &str);
|
||||
void SetDParamStr(size_t n, std::string &&str);
|
||||
|
Reference in New Issue
Block a user