ControlGroup/Slider: Return state data by value

Makes it less error-prone to get state data from sliders (no need
to pass any locals), and also allows direct assignment, letting the
retrieved data be const.
This commit is contained in:
Lioncash
2018-07-13 11:49:05 -04:00
parent 4c30b9e14d
commit 918d448b5b
4 changed files with 25 additions and 25 deletions

View File

@ -13,9 +13,14 @@ namespace ControllerEmu
class Slider : public ControlGroup
{
public:
struct StateData
{
ControlState value{};
};
Slider(const std::string& name_, const std::string& ui_name_);
explicit Slider(const std::string& name_);
void GetState(ControlState* slider);
StateData GetState();
};
} // namespace ControllerEmu