*Some update of kelthuzad script.
--HG-- branch : trunk
This commit is contained in:
@@ -129,6 +129,20 @@ class EventMap : private std::map<uint32, uint32>
|
||||
ScheduleEvent(eventId, time, gcd, phase);
|
||||
}
|
||||
|
||||
void RepeatEvent(uint32 time)
|
||||
{
|
||||
if(empty())
|
||||
return;
|
||||
uint32 eventId = begin()->second;
|
||||
erase(begin());
|
||||
insert(std::make_pair(time, eventId));
|
||||
}
|
||||
|
||||
void PopEvent()
|
||||
{
|
||||
erase(begin());
|
||||
}
|
||||
|
||||
uint32 ExecuteEvent()
|
||||
{
|
||||
while(!empty())
|
||||
@@ -147,6 +161,23 @@ class EventMap : private std::map<uint32, uint32>
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 GetEvent()
|
||||
{
|
||||
while(!empty())
|
||||
{
|
||||
if(begin()->first > m_time)
|
||||
return 0;
|
||||
else if(m_phase && (begin()->second & 0xFF000000) && !(begin()->second & m_phase))
|
||||
erase(begin());
|
||||
else
|
||||
{
|
||||
uint32 eventId = (begin()->second & 0x0000FFFF);
|
||||
return eventId;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DelayEvents(uint32 time, uint32 gcd)
|
||||
{
|
||||
time += m_time;
|
||||
|
||||
Reference in New Issue
Block a user