ControlGroup: Convert group type enum into an enum class

Gets some constants out of the ControllerEmu namespace, and modifies
ControlGroup so that it uses the enum type itself to represent the
underlying type, rather than a u32 value.
This commit is contained in:
Lioncash
2017-02-25 00:35:02 -05:00
parent 51136681df
commit 26f17a1723
14 changed files with 61 additions and 59 deletions

View File

@ -17,18 +17,18 @@ namespace ControllerEmu
{
class Control;
enum
enum class GroupType
{
GROUP_TYPE_OTHER,
GROUP_TYPE_STICK,
GROUP_TYPE_MIXED_TRIGGERS,
GROUP_TYPE_BUTTONS,
GROUP_TYPE_FORCE,
GROUP_TYPE_EXTENSION,
GROUP_TYPE_TILT,
GROUP_TYPE_CURSOR,
GROUP_TYPE_TRIGGERS,
GROUP_TYPE_SLIDER
Other,
Stick,
MixedTriggers,
Buttons,
Force,
Extension,
Tilt,
Cursor,
Triggers,
Slider
};
class ControlGroup
@ -102,8 +102,9 @@ public:
}
};
explicit ControlGroup(const std::string& name, u32 type = GROUP_TYPE_OTHER);
ControlGroup(const std::string& name, const std::string& ui_name, u32 type = GROUP_TYPE_OTHER);
explicit ControlGroup(const std::string& name, GroupType type = GroupType::Other);
ControlGroup(const std::string& name, const std::string& ui_name,
GroupType type = GroupType::Other);
virtual ~ControlGroup();
virtual void LoadConfig(IniFile::Section* sec, const std::string& defdev = "",
@ -115,7 +116,7 @@ public:
const std::string name;
const std::string ui_name;
const u32 type;
const GroupType type;
std::vector<std::unique_ptr<Control>> controls;
std::vector<std::unique_ptr<NumericSetting>> numeric_settings;