diff options
Diffstat (limited to 'src/common/Utilities/EventMap.h')
-rw-r--r-- | src/common/Utilities/EventMap.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/common/Utilities/EventMap.h b/src/common/Utilities/EventMap.h index a9f864267f9..dbb297a1c63 100644 --- a/src/common/Utilities/EventMap.h +++ b/src/common/Utilities/EventMap.h @@ -26,7 +26,7 @@ class TC_COMMON_API EventMap { /** * Internal storage type. - * Key: Time as uint32 when the event should occur. + * Key: Time as TimePoint when the event should occur. * Value: The event data as uint32. * * Structure of event data: @@ -35,10 +35,10 @@ class TC_COMMON_API EventMap * - Bit 24 - 31: Phase * - Pattern: 0xPPGGEEEE */ - typedef std::multimap<uint32, uint32> EventStore; + typedef std::multimap<TimePoint, uint32> EventStore; public: - EventMap() : _time(0), _phase(0), _lastEvent(0) { } + EventMap() : _time(TimePoint::min()), _phase(0), _lastEvent(0) { } /** * @name Reset @@ -53,6 +53,16 @@ public: */ void Update(uint32 time) { + Update(Milliseconds(time)); + } + + /** + * @name Update + * @brief Updates the timer of the event map. + * @param time Value in ms to be added to time. + */ + void Update(Milliseconds time) + { _time += time; } @@ -226,7 +236,7 @@ private: * has reached their time value. Its value is changed in the * Update method. */ - uint32 _time; + TimePoint _time; /** * @name _phase |