Utilities/EventProcessor: Added a overload to AddEventAtOffset accept rand time

(cherry picked from commit 4d9c36c8c3)
This commit is contained in:
Keader
2018-08-26 01:02:58 -03:00
committed by Shauren
parent 37c9553372
commit c2666bd255

View File

@@ -21,6 +21,7 @@
#include "Define.h"
#include "Duration.h"
#include <map>
#include "Random.h"
class EventProcessor;
@@ -78,6 +79,7 @@ class TC_COMMON_API EventProcessor
void KillAllEvents(bool force);
void AddEvent(BasicEvent* event, uint64 e_time, bool set_addtime = true);
void AddEventAtOffset(BasicEvent* event, Milliseconds offset) { AddEvent(event, CalculateTime(offset.count())); }
void AddEventAtOffset(BasicEvent* event, Milliseconds offset, Milliseconds offset2) { AddEvent(event, CalculateTime(urand(offset.count(), offset2.count()))); }
void ModifyEventTime(BasicEvent* event, uint64 newTime);
uint64 CalculateTime(uint64 t_offset) const { return m_time + t_offset; }
std::multimap<uint64, BasicEvent*> const& GetEvents() const { return m_events; }