mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-11 03:38:05 -05:00
settings: Give indices to enums
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
@ -197,6 +198,14 @@ public:
|
||||
return std::type_index(typeid(Type));
|
||||
}
|
||||
|
||||
constexpr u32 EnumIndex() const override {
|
||||
if constexpr (std::is_enum<Type>()) {
|
||||
return EnumMetadata<Type>::Index();
|
||||
} else {
|
||||
return std::numeric_limits<u32>::max();
|
||||
}
|
||||
}
|
||||
|
||||
virtual std::string MinVal() const override {
|
||||
return this->ToString(minimum);
|
||||
}
|
||||
|
Reference in New Issue
Block a user