11#ifndef INCGUARD_MGL_GAMEPAD_STATE_H_1609654412
12#define INCGUARD_MGL_GAMEPAD_STATE_H_1609654412
51 [[nodiscard]]
constexpr bool IsUsing() const noexcept
68 _deviceInfo = deviceInfo;
69 _shouldActivate =
true;
79 _shouldDeactivate =
true;
91 return _identifier == rhs._identifier;
103 return _identifier != rhs._identifier;
115 return _identifier != PadID::Invalid;
126 _playerIndex = playerIndex;
159 if (entry < PadEntry::Reserve_Start)
183 [[nodiscard]]
constexpr bool HasEntry() const noexcept
185 return IsEnabled() && (_entry < PadEntry::Reserve_Start);
196 _buttonFlags.
Set(button);
207 _buttonFlags |= buttonFlags;
229 _leftStick = axisValue;
240 _rightStick = axisValue;
310 return (_buttonFlags & buttonFlags) == buttonFlags;
323 return (_buttonFlags & buttonFlags).HasAny();
374 return _repeatFlags.
Has(button);
385 _isPortraitMode = isEnabled;
397 return _isPortraitMode;
419 _decideButton = button;
430 return _decideButton;
441 _cancelButton = button;
452 return _cancelButton;
475 void Activate() noexcept;
476 void Deactivate() noexcept;
478 void ApplyDecideCancelButton() noexcept;
479 void UpdateRepeatFlags(const
RepeatSetting &repeatSetting) noexcept;
481 PadType _type{PadType::Disable};
482 PadID _identifier{PadID::Invalid};
483 PadDeviceInfo _deviceInfo;
484 bool _isUsing{
false};
493 int32_t _playerIndex{-1};
498 PadButton _decideButton{PadButton::None};
499 PadButton _cancelButton{PadButton::None};
501 bool _isPortraitMode{
false};
503 std::array<float, PadButtonFlags::kSize> _repeatTimerArray;
505 std::atomic<bool> _shouldActivate{
false};
506 std::atomic<bool> _shouldDeactivate{
false};
constexpr bool HasAny() const noexcept
いずれかの値を保持しているかを取得
Definition mgl_bit.h:114
constexpr EnumBitFlags & Set(EnumType value) noexcept
指定した値をセットする
Definition mgl_bit.h:126
constexpr bool Has(EnumType value) const noexcept
指定した値を保持しているかを取得
Definition mgl_bit.h:102
PadEntry
パッドのエントリータイプ
Definition mgl_gamepad_defs.h:164
PadType
ゲームパッドの種類
Definition mgl_gamepad_defs.h:148
PadPriority
パッドのプライオリティ
Definition mgl_gamepad_defs.h:192
PadButton
ゲームパッドのボタンの定義
Definition mgl_gamepad_defs.h:33
EnumBitFlags< PadButton > PadButtonFlags
ゲームパッドボタンの入力状態のビットフラグ型
Definition mgl_gamepad_defs.h:132
2Dベクトル
Definition mgl_vector2.h:23