Core/EventProcessor: std::chrono-ify the remaining public API

(cherry picked from commit 1d8782e356)
This commit is contained in:
Carbenium
2020-07-25 23:51:30 +02:00
committed by Shauren
parent eeffb310de
commit a7cbb16229
5 changed files with 20 additions and 20 deletions

View File

@@ -110,24 +110,24 @@ void EventProcessor::KillAllEvents(bool force)
m_events.clear();
}
void EventProcessor::AddEvent(BasicEvent* event, uint64 e_time, bool set_addtime)
void EventProcessor::AddEvent(BasicEvent* event, Milliseconds e_time, bool set_addtime)
{
if (set_addtime)
event->m_addTime = m_time;
event->m_execTime = e_time;
m_events.insert(std::pair<uint64, BasicEvent*>(e_time, event));
event->m_execTime = e_time.count();
m_events.insert(std::pair<uint64, BasicEvent*>(e_time.count(), event));
}
void EventProcessor::ModifyEventTime(BasicEvent* event, uint64 newTime)
void EventProcessor::ModifyEventTime(BasicEvent* event, Milliseconds newTime)
{
for (auto itr = m_events.begin(); itr != m_events.end(); ++itr)
{
if (itr->second != event)
continue;
event->m_execTime = newTime;
event->m_execTime = newTime.count();
m_events.erase(itr);
m_events.insert(std::pair<uint64, BasicEvent*>(newTime, event));
m_events.insert(std::pair<uint64, BasicEvent*>(newTime.count(), event));
break;
}
}