15 namespace swift::misc::input
23 if (m_keyboardKeys.
contains(key)) {
return; }
30 if (m_joystickButtons.
contains(button)) {
return; }
39 return m_joystickButtons.
contains(button);
47 m_keyboardKeys.
remove(oldKey);
55 m_joystickButtons.
remove(oldButton);
66 return std::all_of(m_keyboardKeys.
begin(), m_keyboardKeys.
end(),
67 [&other](
const CKeyboardKey &k) { return other.m_keyboardKeys.contains(k); }) &&
68 std::all_of(m_joystickButtons.
begin(), m_joystickButtons.
end(),
69 [&other](
const CJoystickButton &b) { return other.m_joystickButtons.contains(b); });
93 sl.reserve(m_keyboardKeys.
size() + m_joystickButtons.
size());
94 for (
const auto &key : m_keyboardKeys) { sl << key.toQString(); }
95 for (
const auto &button : m_joystickButtons) { sl << button.toQString(); }
102 sl.reserve(m_keyboardKeys.
size() + m_joystickButtons.
size());
103 for (
const auto &key : m_keyboardKeys) { sl << key.toQString(); }
104 for (
const auto &button : m_joystickButtons) { sl << button.getButtonAsStringWithDeviceName(); }
bool contains(const T &object) const
Return true if there is an element equal to given object. Uses the most efficient implementation avai...
size_type size() const
Returns number of elements in the sequence.
void sortBy(K1 key1, Keys... keys)
In-place sort by some particular key(s).
iterator begin()
Returns iterator at the beginning of the sequence.
void push_back(const T &value)
Appends an element at the end of the sequence.
int remove(const T &object)
Remove all elements equal to the given object, if it is contained.
iterator end()
Returns iterator one past the end of the sequence.
#define SWIFT_DEFINE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template definition of mixins for a CValueObject subclass.