diff options
author | Treeston <treeston.mmoc@gmail.com> | 2017-11-30 20:45:44 +0100 |
---|---|---|
committer | Treeston <treeston.mmoc@gmail.com> | 2017-11-30 20:55:53 +0100 |
commit | 76a4c7d9748fdbfa925e81a3257acdee53d4f86e (patch) | |
tree | 24646e144b8dcc10b844ff21003dfaff08072851 /src/common/Utilities/EventProcessor.h | |
parent | 032194099e84bf0d47b121d82170c39fe73e0c87 (diff) |
Some misc streamlining/cleanup:
- std::chrono overloads for SummonCreature
- Removed misleading const qualifier from SummonCreature (it wasn't being honored)
- Rename parameters of SummonCreature to follow convention
- EventProcessor has a new method (AddEventAtOffset) that adds an event...at an offset. Genius.
PS: Hi there Keader.
Diffstat (limited to 'src/common/Utilities/EventProcessor.h')
-rw-r--r-- | src/common/Utilities/EventProcessor.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/Utilities/EventProcessor.h b/src/common/Utilities/EventProcessor.h index 9a356b0e3f5..488d4a98649 100644 --- a/src/common/Utilities/EventProcessor.h +++ b/src/common/Utilities/EventProcessor.h @@ -20,6 +20,7 @@ #define __EVENTPROCESSOR_H #include "Define.h" +#include "Duration.h" #include <map> class EventProcessor; @@ -76,9 +77,10 @@ class TC_COMMON_API EventProcessor void Update(uint32 p_time); void KillAllEvents(bool force); - void AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime = true); - void ModifyEventTime(BasicEvent* Event, uint64 newTime); - uint64 CalculateTime(uint64 t_offset) const; + void AddEvent(BasicEvent* event, uint64 e_time, bool set_addtime = true); + void AddEventAtOffset(BasicEvent* event, Milliseconds const& offset) { AddEvent(event, CalculateTime(offset.count())); } + void ModifyEventTime(BasicEvent* event, uint64 newTime); + uint64 CalculateTime(uint64 t_offset) const { return m_time + t_offset; } protected: uint64 m_time; |