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

Method update

src/Core/Input/InputManager.cpp:67–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 }
66
67 void InputManager::update()
68 {
69 if (m_enabled)
70 {
71 auto actionBuffer = m_currentActions;
72 for (auto action : actionBuffer)
73 {
74
75 action->update();
76 }
77 if (m_refresh)
78 {
79 bool noRefresh = true;
80 for (auto& [_, input] : m_inputs)
81 {
82
83 if (input->isPressed())
84 {
85
86 noRefresh = false;
87 break;
88 }
89 }
90 for (const auto& monitorPtr : m_monitors)
91 {
92 if (const auto& monitor = monitorPtr.lock())
93 {
94 if (monitor->getButton().isPressed())
95 {
96 noRefresh = false;
97 break;
98 }
99 }
100 }
101 m_refresh = !noRefresh;
102 m_monitors.erase(
103 std::remove_if(m_monitors.begin(), m_monitors.end(),
104 [this](const std::weak_ptr<InputButtonMonitor>& element) {
105 return updateOrCleanMonitor(t_inputs, element);
106 }),
107 m_monitors.end());
108 }
109 }
110 }
111
112 bool InputManager::actionExists(const std::string& actionId)
113 {

Callers 1

updateOrCleanMonitorFunction · 0.45

Calls 6

updateOrCleanMonitorFunction · 0.85
lockMethod · 0.80
isPressedMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected