#include <Alarm.hpp>
|
| void | Push (eString name, std::function< void()> fnc) |
| |
| void | Update () |
| |
| void | Set (eString name, int32 frames) |
| | Set alarm to -1 to deactivate it.
|
| |
Alarm class for events
Definition at line 23 of file Alarm.hpp.
◆ Push()
| void eAlarm::Push |
( |
eString | name, |
|
|
std::function< void()> | fnc ) |
Definition at line 6 of file Alarm.cpp.
7{
8 if (mAlarms.find(name.
GetStrg()) != mAlarms.end())
return;
11}
const strg & GetStrg() const
Return text as std::string.
◆ Set()
| void eAlarm::Set |
( |
eString | name, |
|
|
int32 | frames ) |
Set alarm to -1 to deactivate it.
Definition at line 29 of file Alarm.cpp.
30{
31 if (mAlarms.find(name.
GetStrg()) == mAlarms.end())
return;
32 mAlarms[name.
GetStrg()].mCnt = frames;
33}
◆ Update()
Definition at line 13 of file Alarm.cpp.
14{
15 for (auto& it : mAlarms)
16 {
17 auto& cnt = it.second.mCnt;
18 if (cnt == -1) continue;
19 cnt--;
20 if (cnt <= 0)
21 {
22 cnt = -1;
23 it.second.mFnc();
24 }
25 }
26}
The documentation for this class was generated from the following files: