#include "helperfuncs.h"
#include "timer.h"
-typedef std::vector<InspTimer*> timergroup;
-typedef std::map<time_t, timergroup*> timerlist;
-
-timerlist Timers;
-
-void TickTimers(time_t TIME)
+void TimerManager::TickTimers(time_t TIME)
{
timerlist::iterator found = Timers.find(TIME);
{
InspTimer* n = *y;
n->Tick(TIME);
- delete n;
+ DELETE(n);
}
Timers.erase(found);
- delete x;
+ DELETE(x);
}
}
* If you move your clock BACK, and your timers move further ahead as a result,
* then tough titty you'll just have to wait.
*/
-void TickMissedTimers(time_t TIME)
+void TimerManager::TickMissedTimers(time_t TIME)
{
for (time_t n = TIME-1; n > TIME-120; n--)
{
{
InspTimer* z = *y;
z->Tick(TIME);
- delete z;
+ DELETE(z);
}
Timers.erase(found);
- delete x;
+ DELETE(x);
}
}
}
-void AddTimer(InspTimer* T)
+void TimerManager::AddTimer(InspTimer* T)
{
timergroup* x = NULL;
x->push_back(T);
}
+