mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Turn Config::Info into a class with getters
This commit is contained in:
@ -30,10 +30,11 @@ struct Location
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct Info
|
||||
class Info
|
||||
{
|
||||
Info(const Location& location_, const T& default_value_)
|
||||
: location{location_}, default_value{default_value_}
|
||||
public:
|
||||
constexpr Info(const Location& location, const T& default_value)
|
||||
: m_location{location}, m_default_value{default_value}
|
||||
{
|
||||
}
|
||||
|
||||
@ -41,13 +42,17 @@ struct Info
|
||||
// so that enum settings can still easily work with code that doesn't care about the enum values.
|
||||
template <typename Enum,
|
||||
std::enable_if_t<std::is_same<T, detail::UnderlyingType<Enum>>::value>* = nullptr>
|
||||
Info(const Info<Enum>& other)
|
||||
: location{other.location}, default_value{static_cast<detail::UnderlyingType<Enum>>(
|
||||
other.default_value)}
|
||||
constexpr Info(const Info<Enum>& other)
|
||||
: m_location{other.GetLocation()}, m_default_value{static_cast<detail::UnderlyingType<Enum>>(
|
||||
other.GetDefaultValue())}
|
||||
{
|
||||
}
|
||||
|
||||
Location location;
|
||||
T default_value;
|
||||
constexpr const Location& GetLocation() const { return m_location; }
|
||||
constexpr const T& GetDefaultValue() const { return m_default_value; }
|
||||
|
||||
private:
|
||||
Location m_location;
|
||||
T m_default_value;
|
||||
};
|
||||
} // namespace Config
|
||||
|
Reference in New Issue
Block a user