MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / update

Method update

src/Core/Input/InputAction.cpp:61–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59 }
60
61 void InputAction::update()
62 {
63 if (!m_enabled)
64 return;
65 for (InputCondition& condition : m_conditions)
66 {
67 if (condition.check())
68 {
69 if (m_state)
70 {
71 if (m_repeat
72 .over()) // Reset repeat when combination is unchecked <REVISION>
73 {
74 m_repeat.reset();
75 const InputActionEvent ev(*this, condition);
76 if (m_callback)
77 m_callback(ev);
78 m_actionTrigger->pushParameter(m_id, "event", ev);
79 m_actionTrigger->trigger(m_id);
80 }
81 }
82 else
83 {
84 if (m_interval
85 .over()) // What is this for, when does m_state goes back to false ? <REVISION>
86 {
87 m_interval.reset();
88 m_state = true;
89 if (m_callback)
90 m_callback(InputActionEvent(*this, condition));
91 }
92 }
93 }
94 else
95 {
96 m_repeat.stop();
97 }
98 }
99 }
100
101 std::vector<InputButton*> InputAction::getInvolvedButtons() const
102 {

Callers

nothing calls this directly

Calls 6

InputActionEventClass · 0.85
overMethod · 0.80
checkMethod · 0.45
resetMethod · 0.45
pushParameterMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected