diff options
Diffstat (limited to 'src/common/Utilities/EventMap.h')
-rw-r--r-- | src/common/Utilities/EventMap.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/common/Utilities/EventMap.h b/src/common/Utilities/EventMap.h index 7bea23bf7e4..82c466408cd 100644 --- a/src/common/Utilities/EventMap.h +++ b/src/common/Utilities/EventMap.h @@ -21,6 +21,7 @@ #include "Define.h" #include "Duration.h" #include <map> +#include <queue> class TC_COMMON_API EventMap { @@ -36,6 +37,7 @@ class TC_COMMON_API EventMap * - Pattern: 0xPPGGEEEE */ typedef std::multimap<TimePoint, uint32> EventStore; + typedef std::map<uint32 /*event data*/, std::queue<Milliseconds>> EventSeriesStore; public: EventMap() : _time(TimePoint::min()), _phase(0), _lastEvent(0) { } @@ -225,6 +227,31 @@ public: */ Milliseconds GetTimeUntilEvent(uint32 eventId) const; + /** + * @name ScheduleNextFromSeries + * @brief Schedules specified event with next timer from series + * @param full event data, including group and phase + */ + void ScheduleNextFromSeries(uint32 eventData); + + /** + * @name ScheduleEventSeries + * @brief Schedules specified event with first value of the series and then requeues with the next + * @param eventId of the event. + * @param group of the event. + * @param phase of the event. + * @param timeSeries specifying the times the event should be automatically scheduled after each trigger (first value is initial schedule) + */ + void ScheduleEventSeries(uint32 eventId, uint8 group, uint8 phase, std::initializer_list<Milliseconds> const& timeSeries); + + /** + * @name ScheduleEventSeries + * @brief Schedules specified event with first value of the series and then requeues with the next + * @param eventId of the event. + * @param timeSeries specifying the times the event should be automatically scheduled after each trigger (first value is initial schedule) + */ + void ScheduleEventSeries(uint32 eventId, std::initializer_list<Milliseconds> const& series); + private: /** * @name _time @@ -262,6 +289,12 @@ private: * @brief Stores information on the most recently executed event */ uint32 _lastEvent; + + /** + * @name _timerSeries + * @brief Stores information about time series which requeue itself until series is empty + */ + EventSeriesStore _timerSeries; }; #endif // _EVENT_MAP_H_ |