2022-09-11 18:45:19 +00:00
|
|
|
#ifndef __CCONTROLLERGAMEPADDATA_HPP__
|
|
|
|
#define __CCONTROLLERGAMEPADDATA_HPP__
|
|
|
|
|
|
|
|
#include "Kyoto/Input/CControllerAxis.hpp"
|
|
|
|
#include "Kyoto/Input/CControllerButton.hpp"
|
2022-09-18 06:05:46 +00:00
|
|
|
#include "Kyoto/Input/InputTypes.hpp"
|
2022-09-11 18:45:19 +00:00
|
|
|
|
|
|
|
class CControllerGamepadData {
|
|
|
|
public:
|
|
|
|
void SetDeviceIsPresent(bool present) { x0_present = present; }
|
|
|
|
bool DeviceIsPresent() const { return x0_present; }
|
|
|
|
|
|
|
|
const CControllerAxis& GetAxis(EJoyAxis axis) const { return x4_axes[axis]; }
|
|
|
|
CControllerAxis& GetAxis(EJoyAxis axis) { return x4_axes[axis]; }
|
|
|
|
|
|
|
|
const CControllerButton& GetButton(EButton button) const { return x34_buttons[button]; }
|
|
|
|
CControllerButton& GetButton(EButton button) { return x34_buttons[button]; }
|
|
|
|
|
2022-09-18 06:05:46 +00:00
|
|
|
const CControllerAxis& GetAnalogButton(EAnalogButton button) const {
|
|
|
|
return x24_triggers[button];
|
|
|
|
}
|
2022-09-11 18:45:19 +00:00
|
|
|
CControllerAxis& GetAnalogButton(EAnalogButton button) { return x24_triggers[button]; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool x0_present;
|
|
|
|
CControllerAxis x4_axes[4];
|
|
|
|
CControllerAxis x24_triggers[2];
|
|
|
|
CControllerButton x34_buttons[12];
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __CCONTROLLERGAMEPADDATA_HPP__
|