mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Utilities/EventProcessor: Added a overload to AddEventAtOffset accept rand time
(cherry picked from commit 4d9c36c8c3)
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user