InputCommon: Clean up creation of inputs.

This commit is contained in:
Jordan Woyak
2019-10-27 11:04:08 -05:00
parent 01d69ba81a
commit 47877ecf2c
30 changed files with 127 additions and 122 deletions

View File

@ -10,14 +10,15 @@
namespace ControllerEmu
{
Control::Control(std::unique_ptr<ControlReference> ref, Translatability translate_,
const std::string& name_, const std::string& ui_name_)
: control_ref(std::move(ref)), translate(translate_), name(name_), ui_name(ui_name_)
std::string name_, std::string ui_name_)
: control_ref(std::move(ref)), translate(translate_), name(std::move(name_)),
ui_name(std::move(ui_name_))
{
}
Control::Control(std::unique_ptr<ControlReference> ref, Translatability translate_,
const std::string& name_)
: Control(std::move(ref), translate_, name_, name_)
std::string name_)
: control_ref(std::move(ref)), translate(translate_), name(name_), ui_name(std::move(name_))
{
}

View File

@ -34,10 +34,9 @@ public:
const std::string ui_name;
protected:
Control(std::unique_ptr<ControlReference> ref, Translatability translate, const std::string& name,
const std::string& ui_name);
Control(std::unique_ptr<ControlReference> ref, Translatability translate,
const std::string& name);
Control(std::unique_ptr<ControlReference> ref, Translatability translate, std::string name,
std::string ui_name);
Control(std::unique_ptr<ControlReference> ref, Translatability translate, std::string name);
};
} // namespace ControllerEmu

View File

@ -10,13 +10,13 @@
namespace ControllerEmu
{
Input::Input(Translatability translate_, const std::string& name_, const std::string& ui_name_)
: Control(std::make_unique<InputReference>(), translate_, name_, ui_name_)
Input::Input(Translatability translate_, std::string name_, std::string ui_name_)
: Control(std::make_unique<InputReference>(), translate_, std::move(name_), std::move(ui_name_))
{
}
Input::Input(Translatability translate_, const std::string& name_)
: Control(std::make_unique<InputReference>(), translate_, name_)
Input::Input(Translatability translate_, std::string name_)
: Control(std::make_unique<InputReference>(), translate_, std::move(name_))
{
}
} // namespace ControllerEmu

View File

@ -12,7 +12,7 @@ namespace ControllerEmu
class Input : public Control
{
public:
Input(Translatability translate, const std::string& name, const std::string& ui_name);
Input(Translatability translate, const std::string& name);
Input(Translatability translate, std::string name, std::string ui_name);
Input(Translatability translate, std::string name);
};
} // namespace ControllerEmu

View File

@ -10,8 +10,8 @@
namespace ControllerEmu
{
Output::Output(Translatability translate_, const std::string& name_)
: Control(std::make_unique<OutputReference>(), translate_, name_)
Output::Output(Translatability translate_, std::string name_)
: Control(std::make_unique<OutputReference>(), translate_, std::move(name_))
{
}
} // namespace ControllerEmu

View File

@ -12,6 +12,6 @@ namespace ControllerEmu
class Output : public Control
{
public:
Output(Translatability translate, const std::string& name);
Output(Translatability translate, std::string name);
};
} // namespace ControllerEmu