Lioncash 97ba02df27 ControlGroup/Tilt: Return state data by value
Makes it less error-prone to get state data from tilt controls (no need
to pass any pointers to locals), and also allows direct assignment,
letting the retrieved data be const.
2018-07-13 13:20:35 -04:00

30 lines
550 B
C++

// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <string>
#include "InputCommon/ControllerEmu/ControlGroup/ControlGroup.h"
#include "InputCommon/ControllerInterface/Device.h"
namespace ControllerEmu
{
class Tilt : public ControlGroup
{
public:
struct StateData
{
ControlState x{};
ControlState y{};
};
explicit Tilt(const std::string& name);
StateData GetState(bool step = true);
private:
StateData m_tilt;
};
} // namespace ControllerEmu