Core/EventMap: Refactor and modernize EventMap (#29183)
(cherry picked from commit 1bea4aab456a01d89b87344d47cf345cd68f2d85)
This commit is contained in:
@@ -26,40 +26,40 @@ void EventMap::Reset()
|
||||
{
|
||||
_eventMap.clear();
|
||||
_time = TimePoint::min();
|
||||
_phase = 0;
|
||||
_phaseMask = 0;
|
||||
}
|
||||
|
||||
void EventMap::SetPhase(uint8 phase)
|
||||
void EventMap::SetPhase(PhaseIndex phase)
|
||||
{
|
||||
if (!phase)
|
||||
_phase = 0;
|
||||
else if (phase <= 8)
|
||||
_phase = uint8(1 << (phase - 1));
|
||||
_phaseMask = 0;
|
||||
else if (phase <= sizeof(PhaseMask) * 8)
|
||||
_phaseMask = PhaseMask(1u << (phase - 1u));
|
||||
}
|
||||
|
||||
void EventMap::ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group /*= 0*/, uint8 phase /*= 0*/)
|
||||
void EventMap::ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group /*= 0*/, PhaseIndex phase /*= 0*/)
|
||||
{
|
||||
if (group && group <= 8)
|
||||
eventId |= (1 << (group + 15));
|
||||
if (group > sizeof(GroupMask) * 8)
|
||||
return;
|
||||
|
||||
if (phase && phase <= 8)
|
||||
eventId |= (1 << (phase + 23));
|
||||
if (phase > sizeof(PhaseMask) * 8)
|
||||
return;
|
||||
|
||||
_eventMap.insert({ _time + time, eventId });
|
||||
_eventMap.emplace(_time + time, Event(eventId, group, phase));
|
||||
}
|
||||
|
||||
void EventMap::ScheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group /*= 0*/, uint8 phase /*= 0*/)
|
||||
void EventMap::ScheduleEvent(EventId eventId, Milliseconds minTime, Milliseconds maxTime, GroupIndex group /*= 0*/, PhaseIndex phase /*= 0*/)
|
||||
{
|
||||
ScheduleEvent(eventId, randtime(minTime, maxTime), group, phase);
|
||||
}
|
||||
|
||||
void EventMap::RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group /*= 0*/, uint8 phase /*= 0*/)
|
||||
void EventMap::RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group, PhaseIndex phase)
|
||||
{
|
||||
CancelEvent(eventId);
|
||||
ScheduleEvent(eventId, time, group, phase);
|
||||
}
|
||||
|
||||
void EventMap::RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group /*= 0*/, uint8 phase /*= 0*/)
|
||||
void EventMap::RescheduleEvent(EventId eventId, Milliseconds minTime, Milliseconds maxTime, GroupIndex group /*= 0*/, PhaseIndex phase /*= 0*/)
|
||||
{
|
||||
RescheduleEvent(eventId, randtime(minTime, maxTime), group, phase);
|
||||
}
|
||||
@@ -74,20 +74,20 @@ void EventMap::Repeat(Milliseconds minTime, Milliseconds maxTime)
|
||||
Repeat(randtime(minTime, maxTime));
|
||||
}
|
||||
|
||||
uint32 EventMap::ExecuteEvent()
|
||||
EventMap::EventId EventMap::ExecuteEvent()
|
||||
{
|
||||
while (!Empty())
|
||||
{
|
||||
EventStore::iterator itr = _eventMap.begin();
|
||||
auto itr = _eventMap.begin();
|
||||
|
||||
if (itr->first > _time)
|
||||
return 0;
|
||||
else if (_phase && (itr->second & 0xFF000000) && !((itr->second >> 24) & _phase))
|
||||
else if (_phaseMask && itr->second._phaseMask && !(itr->second._phaseMask & _phaseMask))
|
||||
_eventMap.erase(itr);
|
||||
else
|
||||
{
|
||||
uint32 eventId = (itr->second & 0x0000FFFF);
|
||||
_lastEvent = itr->second; // include phase/group
|
||||
auto eventId = itr->second._id;
|
||||
_lastEvent = itr->second;
|
||||
_eventMap.erase(itr);
|
||||
ScheduleNextFromSeries(_lastEvent);
|
||||
return eventId;
|
||||
@@ -103,7 +103,7 @@ void EventMap::DelayEvents(Milliseconds delay)
|
||||
return;
|
||||
|
||||
EventStore delayed = std::move(_eventMap);
|
||||
for (EventStore::iterator itr = delayed.begin(); itr != delayed.end();)
|
||||
for (auto itr = delayed.begin(); itr != delayed.end();)
|
||||
{
|
||||
EventStore::node_type node = delayed.extract(itr++);
|
||||
node.key() += delay;
|
||||
@@ -111,15 +111,15 @@ void EventMap::DelayEvents(Milliseconds delay)
|
||||
}
|
||||
}
|
||||
|
||||
void EventMap::DelayEvents(Milliseconds delay, uint32 group)
|
||||
void EventMap::DelayEvents(Milliseconds delay, GroupIndex group)
|
||||
{
|
||||
if (!group || group > 8 || Empty())
|
||||
if (!group || group > sizeof(GroupMask) * 8 || Empty())
|
||||
return;
|
||||
|
||||
EventStore delayed;
|
||||
for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
for (auto itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
{
|
||||
if (itr->second & (1 << (group + 15)))
|
||||
if (itr->second._groupMask & GroupMask(1u << (group - 1u)))
|
||||
{
|
||||
EventStore::node_type node = _eventMap.extract(itr++);
|
||||
node.key() += delay;
|
||||
@@ -132,66 +132,92 @@ void EventMap::DelayEvents(Milliseconds delay, uint32 group)
|
||||
_eventMap.merge(delayed);
|
||||
}
|
||||
|
||||
void EventMap::CancelEvent(uint32 eventId)
|
||||
void EventMap::SetMinimalDelay(EventId eventId, Milliseconds delay)
|
||||
{
|
||||
if (Empty())
|
||||
return;
|
||||
|
||||
for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
for (auto itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
{
|
||||
if (eventId == (itr->second & 0x0000FFFF))
|
||||
_eventMap.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
if (eventId == itr->second._id)
|
||||
{
|
||||
if (itr->first < (_time + delay))
|
||||
{
|
||||
_eventMap.insert(EventStore::value_type(_time + delay, itr->second));
|
||||
itr = _eventMap.erase(itr);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (EventSeriesStore::iterator itr = _timerSeries.begin(); itr != _timerSeries.end();)
|
||||
{
|
||||
if (eventId == (itr->first & 0x0000FFFF))
|
||||
_timerSeries.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void EventMap::CancelEventGroup(uint32 group)
|
||||
void EventMap::CancelEvent(EventId eventId)
|
||||
{
|
||||
if (!group || group > 8 || Empty())
|
||||
if (Empty())
|
||||
return;
|
||||
|
||||
for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
for (auto itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
{
|
||||
if (itr->second & (1 << (group + 15)))
|
||||
if (eventId == itr->second._id)
|
||||
_eventMap.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
|
||||
for (EventSeriesStore::iterator itr = _timerSeries.begin(); itr != _timerSeries.end();)
|
||||
for (auto itr = _timerSeries.begin(); itr != _timerSeries.end();)
|
||||
{
|
||||
if (itr->first & (1 << (group + 15)))
|
||||
if (eventId == itr->first._id)
|
||||
_timerSeries.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
Milliseconds EventMap::GetTimeUntilEvent(uint32 eventId) const
|
||||
void EventMap::CancelEventGroup(GroupIndex group)
|
||||
{
|
||||
for (std::pair<TimePoint const, uint32> const& itr : _eventMap)
|
||||
if (eventId == (itr.second & 0x0000FFFF))
|
||||
return std::chrono::duration_cast<Milliseconds>(itr.first - _time);
|
||||
if (!group || group > sizeof(GroupMask) * 8 || Empty())
|
||||
return;
|
||||
|
||||
for (auto itr = _eventMap.begin(); itr != _eventMap.end();)
|
||||
{
|
||||
if (itr->second._groupMask & GroupMask(1u << (group - 1u)))
|
||||
_eventMap.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
|
||||
for (auto itr = _timerSeries.begin(); itr != _timerSeries.end();)
|
||||
{
|
||||
if (itr->first._groupMask & GroupMask(1 << (group - 1u)))
|
||||
_timerSeries.erase(itr++);
|
||||
else
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
Milliseconds EventMap::GetTimeUntilEvent(EventId eventId) const
|
||||
{
|
||||
for (auto const& [time, event] : _eventMap)
|
||||
if (eventId == event._id)
|
||||
return std::chrono::duration_cast<Milliseconds>(time - _time);
|
||||
|
||||
return Milliseconds::max();
|
||||
}
|
||||
|
||||
void EventMap::ScheduleNextFromSeries(uint32 eventData)
|
||||
bool EventMap::HasEventScheduled(EventId eventId) const
|
||||
{
|
||||
return GetTimeUntilEvent(eventId) != Milliseconds::max();
|
||||
}
|
||||
|
||||
void EventMap::ScheduleNextFromSeries(Event eventData)
|
||||
{
|
||||
EventSeriesStore::iterator itr = _timerSeries.find(eventData);
|
||||
if (itr == _timerSeries.end())
|
||||
return;
|
||||
|
||||
ScheduleEvent(eventData, itr->second.front());
|
||||
_eventMap.emplace(_time + itr->second.front(), eventData);
|
||||
|
||||
if (itr->second.size() > 1)
|
||||
itr->second.erase(itr->second.begin());
|
||||
@@ -199,24 +225,26 @@ void EventMap::ScheduleNextFromSeries(uint32 eventData)
|
||||
_timerSeries.erase(itr);
|
||||
}
|
||||
|
||||
void EventMap::ScheduleEventSeries(uint32 eventId, uint8 group, uint8 phase, std::initializer_list<Milliseconds> timeSeries)
|
||||
void EventMap::ScheduleEventSeries(EventId eventId, GroupIndex group, PhaseIndex phase, std::initializer_list<Milliseconds> timeSeries)
|
||||
{
|
||||
if (group > sizeof(GroupMask) * 8)
|
||||
return;
|
||||
|
||||
if (phase > sizeof(PhaseMask) * 8)
|
||||
return;
|
||||
|
||||
if (!timeSeries.size())
|
||||
return;
|
||||
|
||||
if (group && group <= 8)
|
||||
eventId |= (1 << (group + 15));
|
||||
Event event(eventId, group, phase);
|
||||
|
||||
if (phase && phase <= 8)
|
||||
eventId |= (1 << (phase + 23));
|
||||
|
||||
std::vector<Milliseconds>& series = _timerSeries[eventId];
|
||||
std::vector<Milliseconds>& series = _timerSeries[event];
|
||||
series.insert(series.end(), timeSeries.begin(), timeSeries.end());
|
||||
|
||||
ScheduleNextFromSeries(eventId);
|
||||
ScheduleNextFromSeries(event);
|
||||
}
|
||||
|
||||
void EventMap::ScheduleEventSeries(uint32 eventId, std::initializer_list<Milliseconds> timeSeries)
|
||||
void EventMap::ScheduleEventSeries(EventId eventId, std::initializer_list<Milliseconds> timeSeries)
|
||||
{
|
||||
ScheduleEventSeries(eventId, 0, 0, timeSeries);
|
||||
}
|
||||
|
||||
@@ -15,32 +15,48 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _EVENT_MAP_H_
|
||||
#define _EVENT_MAP_H_
|
||||
#ifndef TRINITYCORE_EVENT_MAP_H
|
||||
#define TRINITYCORE_EVENT_MAP_H
|
||||
|
||||
#include "Define.h"
|
||||
#include "Duration.h"
|
||||
#include <compare>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class TC_COMMON_API EventMap
|
||||
{
|
||||
using EventId = uint16;
|
||||
using GroupIndex = uint8;
|
||||
using GroupMask = uint8;
|
||||
using PhaseIndex = uint8;
|
||||
using PhaseMask = uint8;
|
||||
struct Event
|
||||
{
|
||||
Event() = default;
|
||||
Event(EventId id, GroupIndex groupIndex, PhaseIndex phaseIndex) :
|
||||
_id(id),
|
||||
_groupMask(groupIndex ? GroupMask(1u << (groupIndex - 1u)) : 0u),
|
||||
_phaseMask(phaseIndex ? PhaseMask(1u << (phaseIndex - 1u)) : 0u)
|
||||
{
|
||||
}
|
||||
|
||||
EventId _id = 0u;
|
||||
GroupMask _groupMask = 0u;
|
||||
PhaseMask _phaseMask = 0u;
|
||||
|
||||
std::strong_ordering operator<=>(Event const& right) const = default;
|
||||
};
|
||||
|
||||
/**
|
||||
* Internal storage type.
|
||||
* Key: Time as TimePoint when the event should occur.
|
||||
* Value: The event data as uint32.
|
||||
*
|
||||
* Structure of event data:
|
||||
* - Bit 0 - 15: Event Id.
|
||||
* - Bit 16 - 23: Group
|
||||
* - Bit 24 - 31: Phase
|
||||
* - Pattern: 0xPPGGEEEE
|
||||
*/
|
||||
typedef std::multimap<TimePoint, uint32> EventStore;
|
||||
typedef std::map<uint32 /*event data*/, std::vector<Milliseconds>> EventSeriesStore;
|
||||
* Internal storage type.
|
||||
* Key: Time as TimePoint when the event should occur.
|
||||
*/
|
||||
using EventStore = std::multimap<TimePoint, Event>;
|
||||
using EventSeriesStore = std::map<Event, std::vector<Milliseconds>>;
|
||||
|
||||
public:
|
||||
EventMap() : _time(TimePoint::min()), _phase(0), _lastEvent(0) { }
|
||||
EventMap() : _time(TimePoint::min()), _phaseMask(0) { }
|
||||
EventMap(EventMap const& other);
|
||||
EventMap(EventMap&& other) noexcept = default;
|
||||
EventMap& operator=(EventMap const& other);
|
||||
@@ -77,9 +93,9 @@ public:
|
||||
* @name GetPhaseMask
|
||||
* @return Active phases as mask.
|
||||
*/
|
||||
uint8 GetPhaseMask() const
|
||||
PhaseMask GetPhaseMask() const
|
||||
{
|
||||
return _phase;
|
||||
return _phaseMask;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,50 +112,50 @@ public:
|
||||
* @brief Sets the phase of the map (absolute).
|
||||
* @param phase Phase which should be set. Values: 1 - 8. 0 resets phase.
|
||||
*/
|
||||
void SetPhase(uint8 phase);
|
||||
void SetPhase(PhaseIndex phase);
|
||||
|
||||
/**
|
||||
* @name AddPhase
|
||||
* @brief Activates the given phase (bitwise).
|
||||
* @brief Activates the given phase (absolute).
|
||||
* @param phase Phase which should be activated. Values: 1 - 8
|
||||
*/
|
||||
void AddPhase(uint8 phase)
|
||||
void AddPhase(PhaseIndex phase)
|
||||
{
|
||||
if (phase && phase <= 8)
|
||||
_phase |= uint8(1 << (phase - 1));
|
||||
if (phase && phase <= sizeof(PhaseMask) * 8)
|
||||
_phaseMask |= PhaseMask(1u << (phase - 1u));
|
||||
}
|
||||
|
||||
/**
|
||||
* @name RemovePhase
|
||||
* @brief Deactivates the given phase (bitwise).
|
||||
* @brief Deactivates the given phase (absolute).
|
||||
* @param phase Phase which should be deactivated. Values: 1 - 8.
|
||||
*/
|
||||
void RemovePhase(uint8 phase)
|
||||
void RemovePhase(PhaseIndex phase)
|
||||
{
|
||||
if (phase && phase <= 8)
|
||||
_phase &= uint8(~(1 << (phase - 1)));
|
||||
if (phase && phase <= sizeof(PhaseMask) * 8)
|
||||
_phaseMask &= PhaseMask(~(1u << (phase - 1u)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @name ScheduleEvent
|
||||
* @brief Schedules a new event. An existing event is not canceled.
|
||||
* @brief Creates new event entry in map.
|
||||
* @param eventId The id of the new event.
|
||||
* @param time The time until the event occurs as std::chrono type.
|
||||
* @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group.
|
||||
* @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases.
|
||||
*/
|
||||
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group = 0, uint8 phase = 0);
|
||||
void ScheduleEvent(EventId eventId, Milliseconds time, GroupIndex group = 0u, PhaseIndex phase = 0u);
|
||||
|
||||
/**
|
||||
* @name ScheduleEvent
|
||||
* @brief Schedules a new event. An existing event is not canceled.
|
||||
* @brief Creates new event entry in map.
|
||||
* @param eventId The id of the new event.
|
||||
* @param minTime The minimum time until the event occurs as std::chrono type.
|
||||
* @param maxTime The maximum time until the event occurs as std::chrono type.
|
||||
* @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group.
|
||||
* @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases.
|
||||
*/
|
||||
void ScheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group = 0, uint8 phase = 0);
|
||||
void ScheduleEvent(EventId eventId, Milliseconds minTime, Milliseconds maxTime, GroupIndex group = 0u, PhaseIndex phase = 0u);
|
||||
|
||||
/**
|
||||
* @name RescheduleEvent
|
||||
@@ -149,7 +165,7 @@ public:
|
||||
* @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group.
|
||||
* @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases.
|
||||
*/
|
||||
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group = 0, uint8 phase = 0);
|
||||
void RescheduleEvent(EventId eventId, Milliseconds time, GroupIndex group = 0u, PhaseIndex phase = 0u);
|
||||
|
||||
/**
|
||||
* @name RescheduleEvent
|
||||
@@ -160,7 +176,7 @@ public:
|
||||
* @param group The group which the event is associated to. Has to be between 1 and 8. 0 means it has no group.
|
||||
* @param phase The phase in which the event can occur. Has to be between 1 and 8. 0 means it can occur in all phases.
|
||||
*/
|
||||
void RescheduleEvent(uint32 eventId, Milliseconds minTime, Milliseconds maxTime, uint32 group = 0, uint8 phase = 0);
|
||||
void RescheduleEvent(EventId eventId, Milliseconds minTime, Milliseconds maxTime, GroupIndex group = 0u, PhaseIndex phase = 0u);
|
||||
|
||||
/**
|
||||
* @name RepeatEvent
|
||||
@@ -179,10 +195,10 @@ public:
|
||||
|
||||
/**
|
||||
* @name ExecuteEvent
|
||||
* @brief Returns the next event to be executed and removes it from map.
|
||||
* @brief Returns the next event to execute and removes it from map.
|
||||
* @return Id of the event to execute.
|
||||
*/
|
||||
uint32 ExecuteEvent();
|
||||
EventId ExecuteEvent();
|
||||
|
||||
/**
|
||||
* @name DelayEvents
|
||||
@@ -197,21 +213,29 @@ public:
|
||||
* @param delay Amount of delay as std::chrono type.
|
||||
* @param group Group of the events.
|
||||
*/
|
||||
void DelayEvents(Milliseconds delay, uint32 group);
|
||||
void DelayEvents(Milliseconds delay, GroupIndex group);
|
||||
|
||||
/**
|
||||
* @name SetMinimalDelay
|
||||
* @brief Increase event delay if smaller than given delay.
|
||||
* @param eventId The id of the event.
|
||||
* @param delay Minimum delay for given event.
|
||||
*/
|
||||
void SetMinimalDelay(EventId eventId, Milliseconds delay);
|
||||
|
||||
/**
|
||||
* @name CancelEvent
|
||||
* @brief Cancels all events of the specified id.
|
||||
* @param eventId Event id to cancel.
|
||||
*/
|
||||
void CancelEvent(uint32 eventId);
|
||||
void CancelEvent(EventId eventId);
|
||||
|
||||
/**
|
||||
* @name CancelEventGroup
|
||||
* @brief Cancel events belonging to specified group.
|
||||
* @param group Group to cancel.
|
||||
*/
|
||||
void CancelEventGroup(uint32 group);
|
||||
void CancelEventGroup(GroupIndex group);
|
||||
|
||||
/**
|
||||
* @name IsInPhase
|
||||
@@ -219,25 +243,33 @@ public:
|
||||
* @param phase Wanted phase.
|
||||
* @return True, if phase of event map contains specified phase.
|
||||
*/
|
||||
bool IsInPhase(uint8 phase) const
|
||||
bool IsInPhase(PhaseIndex phase) const
|
||||
{
|
||||
return phase <= 8 && (!phase || _phase & (1 << (phase - 1)));
|
||||
return phase <= sizeof(PhaseIndex) * 8 && (!phase || _phaseMask & PhaseMask(1u << (phase - 1u)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @name GetTimeUntilEvent
|
||||
* @brief Returns time as std::chrono type until next event.
|
||||
* @param eventId of the event.
|
||||
* @param eventId The id of the event.
|
||||
* @return Time of next event. If event is not scheduled returns Milliseconds::max()
|
||||
*/
|
||||
Milliseconds GetTimeUntilEvent(uint32 eventId) const;
|
||||
Milliseconds GetTimeUntilEvent(EventId eventId) const;
|
||||
|
||||
/**
|
||||
* @name HasEventScheduled
|
||||
* @brief Returns whether an event is scheduled
|
||||
* @param eventId The id of the event.
|
||||
* @return True if event is scheduled
|
||||
*/
|
||||
bool HasEventScheduled(EventId eventId) const;
|
||||
|
||||
/**
|
||||
* @name ScheduleNextFromSeries
|
||||
* @brief Schedules specified event with next timer from series
|
||||
* @param full event data, including group and phase
|
||||
* @param eventData full event data, including group and phase
|
||||
*/
|
||||
void ScheduleNextFromSeries(uint32 eventData);
|
||||
void ScheduleNextFromSeries(Event eventData);
|
||||
|
||||
/**
|
||||
* @name ScheduleEventSeries
|
||||
@@ -247,7 +279,7 @@ public:
|
||||
* @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> timeSeries);
|
||||
void ScheduleEventSeries(EventId eventId, GroupIndex group, PhaseIndex phase, std::initializer_list<Milliseconds> timeSeries);
|
||||
|
||||
/**
|
||||
* @name ScheduleEventSeries
|
||||
@@ -255,7 +287,7 @@ public:
|
||||
* @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> series);
|
||||
void ScheduleEventSeries(EventId eventId, std::initializer_list<Milliseconds> timeSeries);
|
||||
|
||||
private:
|
||||
/**
|
||||
@@ -271,14 +303,14 @@ private:
|
||||
TimePoint _time;
|
||||
|
||||
/**
|
||||
* @name _phase
|
||||
* @name _phaseMask
|
||||
* @brief Phase mask of the event map.
|
||||
*
|
||||
* Contains the phases the event map is in. Multiple
|
||||
* phases from 1 to 8 can be set with SetPhase or
|
||||
* AddPhase. RemovePhase deactives a phase.
|
||||
*/
|
||||
uint8 _phase;
|
||||
PhaseMask _phaseMask;
|
||||
|
||||
/**
|
||||
* @name _eventMap
|
||||
@@ -293,7 +325,7 @@ private:
|
||||
* @name _lastEvent
|
||||
* @brief Stores information on the most recently executed event
|
||||
*/
|
||||
uint32 _lastEvent;
|
||||
Event _lastEvent;
|
||||
|
||||
/**
|
||||
* @name _timerSeries
|
||||
@@ -302,4 +334,4 @@ private:
|
||||
EventSeriesStore _timerSeries;
|
||||
};
|
||||
|
||||
#endif // _EVENT_MAP_H_
|
||||
#endif // TRINITYCORE_EVENT_MAP_H
|
||||
|
||||
Reference in New Issue
Block a user