![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "TaskScheduler.h"
Classes | |
struct | Compare |
Container which provides Task order, insert and reschedule operations. More... | |
class | Task |
class | TaskQueue |
Public Member Functions | |
TaskScheduler () | |
template<typename P > | |
TaskScheduler (P &&predicate) | |
TaskScheduler (TaskScheduler const &)=delete | |
TaskScheduler (TaskScheduler &&)=delete | |
TaskScheduler & | operator= (TaskScheduler const &)=delete |
TaskScheduler & | operator= (TaskScheduler &&)=delete |
template<typename P > | |
TaskScheduler & | SetValidator (P &&predicate) |
Sets a validator which is asked if tasks are allowed to be executed. | |
TaskScheduler & | ClearValidator () |
Clears the validator which is asked if tasks are allowed to be executed. | |
TaskScheduler & | Update (success_t const &callback=EmptyCallback) |
TaskScheduler & | Update (size_t const milliseconds, success_t const &callback=EmptyCallback) |
template<class _Rep , class _Period > | |
TaskScheduler & | Update (std::chrono::duration< _Rep, _Period > const &difftime, success_t const &callback=EmptyCallback) |
TaskScheduler & | Async (std::function< void()> const &callable) |
template<class _Rep , class _Period > | |
TaskScheduler & | Schedule (std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task) |
template<class _Rep , class _Period > | |
TaskScheduler & | Schedule (std::chrono::duration< _Rep, _Period > const &time, group_t const group, task_handler_t const &task) |
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
TaskScheduler & | Schedule (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max, task_handler_t const &task) |
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
TaskScheduler & | Schedule (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max, group_t const group, task_handler_t const &task) |
TaskScheduler & | CancelAll () |
TaskScheduler & | CancelGroup (group_t const group) |
TaskScheduler & | CancelGroupsOf (std::vector< group_t > const &groups) |
bool | IsGroupScheduled (group_t const group) |
Check if the group exists and is currently scheduled. | |
template<class _Rep , class _Period > | |
TaskScheduler & | DelayAll (std::chrono::duration< _Rep, _Period > const &duration) |
Delays all tasks with the given duration. | |
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
TaskScheduler & | DelayAll (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
Delays all tasks with a random duration between min and max. | |
template<class _Rep , class _Period > | |
TaskScheduler & | DelayGroup (group_t const group, std::chrono::duration< _Rep, _Period > const &duration) |
Delays all tasks of a group with the given duration. | |
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
TaskScheduler & | DelayGroup (group_t const group, std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
Delays all tasks of a group with a random duration between min and max. | |
template<class _Rep , class _Period > | |
TaskScheduler & | RescheduleAll (std::chrono::duration< _Rep, _Period > const &duration) |
Reschedule all tasks with a given duration. | |
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
TaskScheduler & | RescheduleAll (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
Reschedule all tasks with a random duration between min and max. | |
template<class _Rep , class _Period > | |
TaskScheduler & | RescheduleGroup (group_t const group, std::chrono::duration< _Rep, _Period > const &duration) |
Reschedule all tasks of a group with the given duration. | |
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
TaskScheduler & | RescheduleGroup (group_t const group, std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
Reschedule all tasks of a group with a random duration between min and max. | |
Private Types | |
typedef std::chrono::steady_clock | clock_t |
typedef clock_t::time_point | timepoint_t |
typedef clock_t::duration | duration_t |
typedef uint32 | group_t |
typedef uint32 | repeated_t |
typedef std::function< void(TaskContext)> | task_handler_t |
typedef std::function< bool()> | predicate_t |
typedef std::function< void()> | success_t |
typedef std::shared_ptr< Task > | TaskContainer |
typedef std::queue< std::function< void()> > | AsyncHolder |
Private Member Functions | |
TaskScheduler & | InsertTask (TaskContainer task) |
Insert a new task to the enqueued tasks. | |
template<class _Rep , class _Period > | |
TaskScheduler & | ScheduleAt (timepoint_t const &end, std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task) |
template<class _Rep , class _Period > | |
TaskScheduler & | ScheduleAt (timepoint_t const &end, std::chrono::duration< _Rep, _Period > const &time, group_t const group, task_handler_t const &task) |
void | Dispatch (success_t const &callback) |
Dispatch remaining tasks. | |
Static Private Member Functions | |
static bool | EmptyValidator () |
static void | EmptyCallback () |
template<class _RepLeft , class _PeriodLeft , class _RepRight , class _PeriodRight > | |
static std::chrono::milliseconds | RandomDurationBetween (std::chrono::duration< _RepLeft, _PeriodLeft > const &min, std::chrono::duration< _RepRight, _PeriodRight > const &max) |
Private Attributes | |
std::shared_ptr< TaskScheduler > | self_reference |
Contains a self reference to track if this object was deleted or not. | |
timepoint_t | _now |
The current time point (now) | |
TaskQueue | _task_holder |
The Task Queue which contains all task objects. | |
AsyncHolder | _asyncHolder |
predicate_t | _predicate |
Friends | |
class | TaskContext |
The TaskScheduler class provides the ability to schedule std::function's in the near future. Use TaskScheduler::Update to update the scheduler. Popular methods are:
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
inline |
|
inline |
|
delete |
|
delete |
TaskScheduler & TaskScheduler::Async | ( | std::function< void()> const & | callable | ) |
Schedule an callable function that is executed at the next update tick. Its safe to modify the TaskScheduler from within the callable.
References _asyncHolder.
Referenced by TaskContext::Async().
TaskScheduler & TaskScheduler::CancelAll | ( | ) |
Cancels all tasks. Never call this from within a task context! Use TaskContext::CancelAll instead!
Clear the task holder
References _asyncHolder, _task_holder, and TaskScheduler::TaskQueue::Clear().
Referenced by BossAI::_JustDied(), BossAI::_Reset(), TaskContext::CancelAll(), instance_the_black_morass::instance_the_black_morass_InstanceMapScript::CleanupInstance(), boss_julianne::DamageTaken(), boss_bug_trio::DamageTaken(), npc_drakonid_spawner::DoAction(), boss_twinemperorsAI::EnterEvadeMode(), boss_glob_of_viscidus::InitializeAI(), boss_thekal::boss_thekalAI::JustEngagedWith(), npc_anubisath_guardian::JustEngagedWith(), npc_ahnqiraji_critter::JustEngagedWith(), boss_nazan::JustEngagedWith(), boss_high_botanist_freywinn::JustEngagedWith(), boss_jindo::JustEngagedWith(), boss_fankriss::JustEngagedWith(), boss_grand_warlock_nethekurse::JustEngagedWith(), npc_shattered_hand_scout::MovementInform(), instance_ruins_of_ahnqiraj::instance_ruins_of_ahnqiraj_InstanceMapScript::OnUnitDeath(), boss_mor_grayhoof::Reset(), npc_corrupted_totem::Reset(), npc_lava_spawn::Reset(), boss_nightbane::Reset(), boss_servant_quarters::Reset(), boss_shade_of_aran::Reset(), npc_aran_elemental::Reset(), npc_kilrek::Reset(), npc_fiendish_imp::Reset(), boss_kormok::Reset(), npc_apothecary_baxter::Reset(), boss_baroness_anastari::boss_baroness_anastariAI::Reset(), boss_jarien::Reset(), boss_sothos::Reset(), boss_twilight_corrupter::Reset(), npc_batrider::Reset(), npc_healing_ward::Reset(), npc_shade_of_jindo::Reset(), npc_ohgan::npc_ohganAI::Reset(), npc_vilebranch_speaker::Reset(), npc_spawn_of_marli::Reset(), npc_zealot_lorkhan::npc_zealot_lorkhanAI::Reset(), npc_zealot_zath::npc_zealot_zathAI::Reset(), boss_azuregos::boss_azuregosAI::Reset(), boss_isalien::Reset(), boss_ayamiss::Reset(), npc_hivezara_stinger::Reset(), npc_obsidian_destroyer::Reset(), boss_bug_trio::Reset(), boss_eye_of_cthun::Reset(), boss_cthun::Reset(), boss_fankriss::Reset(), boss_ouro::Reset(), boss_viscidus::Reset(), npc_anubisath_defender::Reset(), npc_vekniss_stinger::Reset(), npc_obsidian_eradicator::Reset(), npc_anubisath_warder::Reset(), npc_obsidian_nullifier::Reset(), npc_ahnqiraji_critter::Reset(), boss_doomlord_kazzak::boss_doomlordkazzakAI::Reset(), boss_doomwalker::boss_doomwalkerAI::Reset(), boss_hungarfen::Reset(), npc_underbat::Reset(), boss_olm_the_summoner::Reset(), boss_kiggler_the_crazed::Reset(), boss_blindeye_the_seer::Reset(), boss_krosh_firehand::Reset(), boss_vazruden::Reset(), boss_magtheridon::Reset(), npc_raging_flames::Reset(), instance_ruins_of_ahnqiraj::instance_ruins_of_ahnqiraj_InstanceMapScript::ResetRajaxxWaves(), npc_dream_fog::npc_dream_fogAI::ScheduleEvents(), npc_shattered_hand_scout::SetData(), npc_warchief_portal::SetData(), World::ShutdownServ(), and boss_cthun::SummonedCreatureDies().
TaskScheduler & TaskScheduler::CancelGroup | ( | group_t const | group | ) |
Cancel all tasks of a single group. Never call this from within a task context! Use TaskContext::CancelGroup instead!
References _task_holder, and TaskScheduler::TaskQueue::RemoveIf().
Referenced by TaskContext::CancelGroup(), CancelGroupsOf(), boss_mor_grayhoof::DamageTaken(), boss_ayamiss::DamageTaken(), boss_ouro::DamageTaken(), boss_julianne::DoAction(), boss_romulo::DoAction(), boss_twinemperorsAI::DoAction(), boss_magtheridon::DoAction(), boss_grand_warlock_nethekurse::DoAction(), boss_nazan::DoAction(), boss_moroes::JustEngagedWith(), boss_malchezaar::Reset(), boss_magtheridon::ScheduleCombatEvents(), instance_the_black_morass::instance_the_black_morass_InstanceMapScript::ScheduleNextPortal(), instance_ruins_of_ahnqiraj::instance_ruins_of_ahnqiraj_InstanceMapScript::SetData(), boss_julianne::SpellHit(), boss_ouro::Submerge(), boss_netherspite::SwitchToBanishPhase(), boss_netherspite::SwitchToPortalPhase(), and boss_nightbane::TakeOff().
TaskScheduler & TaskScheduler::CancelGroupsOf | ( | std::vector< group_t > const & | groups | ) |
Cancels all groups in the given std::vector. Hint: Use std::initializer_list for this: "{1, 2, 3, 4}"
References CancelGroup().
Referenced by TaskContext::CancelGroupsOf().
TaskScheduler & TaskScheduler::ClearValidator | ( | ) |
Clears the validator which is asked if tasks are allowed to be executed.
References _predicate, and EmptyValidator().
|
inline |
Delays all tasks with the given duration.
References _task_holder, and TaskScheduler::TaskQueue::ModifyIf().
Referenced by DelayAll(), boss_bug_trio::DoAction(), boss_twinemperorsAI::DoAction(), boss_nexusprince_shaffar::JustEngagedWith(), boss_anzu::JustEngagedWith(), boss_blackheart_the_inciter::JustEngagedWith(), boss_swamplord_muselek::JustEngagedWith(), boss_gruul::JustEngagedWith(), boss_high_king_maulgar::JustEngagedWith(), boss_nazan::JustEngagedWith(), boss_curator::JustEngagedWith(), boss_moroes::JustEngagedWith(), boss_anzu::Reset(), boss_hungarfen::Reset(), and boss_magtheridon::Reset().
|
inline |
Delays all tasks with a random duration between min and max.
References DelayAll(), and RandomDurationBetween().
|
inline |
Delays all tasks of a group with the given duration.
References _task_holder, and TaskScheduler::TaskQueue::ModifyIf().
Referenced by boss_mor_grayhoof::DamageTaken(), DelayGroup(), boss_malchezaar::JustEngagedWith(), and boss_kelidan_the_breaker::JustEngagedWith().
|
inline |
Delays all tasks of a group with a random duration between min and max.
References DelayGroup(), and RandomDurationBetween().
|
private |
Dispatch remaining tasks.
References _asyncHolder, _now, _predicate, _task_holder, TaskScheduler::TaskQueue::First(), TaskContext::Invoke(), TaskScheduler::TaskQueue::IsEmpty(), TaskScheduler::TaskQueue::Pop(), and self_reference.
Referenced by TaskContext::Async(), TaskContext::CancelAll(), TaskContext::CancelGroup(), TaskContext::CancelGroupsOf(), and Update().
|
inlinestaticprivate |
|
inlinestaticprivate |
Referenced by ClearValidator().
|
private |
Insert a new task to the enqueued tasks.
References _task_holder, and TaskScheduler::TaskQueue::Push().
Referenced by TaskContext::Repeat(), and ScheduleAt().
bool TaskScheduler::IsGroupScheduled | ( | group_t const | group | ) |
Check if the group exists and is currently scheduled.
References _task_holder, and TaskScheduler::TaskQueue::IsGroupQueued().
Referenced by boss_murmur::JustEngagedWith().
|
delete |
|
delete |
|
inlinestaticprivate |
References urand().
Referenced by DelayAll(), TaskContext::DelayAll(), DelayGroup(), TaskContext::DelayGroup(), TaskContext::Repeat(), RescheduleAll(), TaskContext::RescheduleAll(), RescheduleGroup(), TaskContext::RescheduleGroup(), Schedule(), and TaskContext::Schedule().
|
inline |
Reschedule all tasks with a given duration.
References _now, _task_holder, and TaskScheduler::TaskQueue::ModifyIf().
Referenced by TaskContext::RescheduleAll(), and RescheduleAll().
|
inline |
Reschedule all tasks with a random duration between min and max.
References RandomDurationBetween(), and RescheduleAll().
|
inline |
Reschedule all tasks of a group with the given duration.
References _now, _task_holder, and TaskScheduler::TaskQueue::ModifyIf().
Referenced by RescheduleGroup().
|
inline |
Reschedule all tasks of a group with a random duration between min and max.
References RandomDurationBetween(), and RescheduleGroup().
|
inline |
Schedule an event with a fixed rate. Never call this from within a task context! Use TaskContext::Schedule instead!
References _now, and ScheduleAt().
|
inline |
Schedule an event with a fixed rate. Never call this from within a task context! Use TaskContext::Schedule instead!
References _now, and ScheduleAt().
Referenced by boss_mor_grayhoof::CastRandomSpell(), boss_thekal::boss_thekalAI::CheckPhaseTransition(), boss_mor_grayhoof::DamageTaken(), boss_isalien::DamageTaken(), boss_julianne::DamageTaken(), boss_romulo::DamageTaken(), boss_ouro::DamageTaken(), boss_viscidus::DamageTaken(), boss_julianne::DoAction(), boss_romulo::DoAction(), boss_apothecary_hummel::boss_apothecary_hummelAI::DoAction(), boss_twinemperorsAI::DoAction(), npc_thrall_warchief::npc_thrall_warchiefAI::DoAction(), boss_broggok::DoAction(), boss_magtheridon::DoAction(), boss_pathaleon_the_calculator::DoAction(), boss_ouro::Emerge(), boss_jindo::EnterEvadeMode(), boss_warbringer_omrogg::HandleHeadTalk(), boss_glob_of_viscidus::InitializeAI(), npc_underbog_mushroom::InitializeAI(), boss_moroes::InitializeGuests(), boss_grand_warlock_nethekurse::IntroRP(), npc_corrupted_totem::IsSummonedBy(), boss_kormok::IsSummonedBy(), boss_jarien::IsSummonedBy(), boss_sothos::IsSummonedBy(), npc_anzu_spirit::IsSummonedBy(), npc_raging_flames::IsSummonedBy(), npc_drakonid_spawner::IsSummonedBy(), boss_attumen::IsSummonedBy(), boss_mor_grayhoof::JustEngagedWith(), npc_lava_spawn::JustEngagedWith(), boss_malchezaar::JustEngagedWith(), npc_malchezaar_axe::JustEngagedWith(), boss_servant_quarters::JustEngagedWith(), boss_shade_of_aran::JustEngagedWith(), npc_aran_elemental::JustEngagedWith(), npc_kilrek::JustEngagedWith(), npc_fiendish_imp::JustEngagedWith(), boss_terestian_illhoof::JustEngagedWith(), boss_dorothee::JustEngagedWith(), npc_tito::JustEngagedWith(), boss_roar::JustEngagedWith(), boss_strawman::JustEngagedWith(), boss_tinhead::JustEngagedWith(), boss_crone::JustEngagedWith(), npc_cyclone::JustEngagedWith(), boss_bigbadwolf::JustEngagedWith(), boss_kormok::JustEngagedWith(), boss_baroness_anastari::boss_baroness_anastariAI::JustEngagedWith(), boss_jarien::JustEngagedWith(), boss_sothos::JustEngagedWith(), boss_twilight_corrupter::JustEngagedWith(), npc_batrider::JustEngagedWith(), npc_vilebranch_speaker::JustEngagedWith(), npc_spawn_of_marli::JustEngagedWith(), boss_thekal::boss_thekalAI::JustEngagedWith(), npc_zealot_lorkhan::npc_zealot_lorkhanAI::JustEngagedWith(), npc_zealot_zath::npc_zealot_zathAI::JustEngagedWith(), npc_hallows_end_soh::JustEngagedWith(), boss_azuregos::boss_azuregosAI::JustEngagedWith(), boss_epoch_hunter::JustEngagedWith(), boss_lieutenant_drake::JustEngagedWith(), boss_aeonus::JustEngagedWith(), boss_chrono_lord_deja::JustEngagedWith(), boss_temporus::JustEngagedWith(), boss_isalien::JustEngagedWith(), npc_anubisath_guardian::JustEngagedWith(), npc_obsidian_destroyer::JustEngagedWith(), npc_eye_tentacle::JustEngagedWith(), npc_claw_tentacle::JustEngagedWith(), npc_dirt_mound::JustEngagedWith(), npc_anubisath_defender::JustEngagedWith(), npc_obsidian_eradicator::JustEngagedWith(), npc_anubisath_warder::JustEngagedWith(), npc_obsidian_nullifier::JustEngagedWith(), npc_ahnqiraji_critter::JustEngagedWith(), npc_icc_spire_frostwyrm::JustEngagedWith(), boss_exarch_maladaar::JustEngagedWith(), boss_shirrak_the_dead_watcher::JustEngagedWith(), boss_nexusprince_shaffar::JustEngagedWith(), npc_yor::JustEngagedWith(), boss_tavarok::JustEngagedWith(), boss_anzu::JustEngagedWith(), boss_darkweaver_syth::JustEngagedWith(), boss_talon_king_ikiss::JustEngagedWith(), boss_ambassador_hellmaw::JustEngagedWith(), boss_blackheart_the_inciter::JustEngagedWith(), boss_grandmaster_vorpil::JustEngagedWith(), boss_doomlord_kazzak::boss_doomlordkazzakAI::JustEngagedWith(), boss_doomwalker::boss_doomwalkerAI::JustEngagedWith(), boss_mennu_the_betrayer::JustEngagedWith(), boss_quagmirran::JustEngagedWith(), boss_rokmar_the_crackler::JustEngagedWith(), boss_hydromancer_thespia::JustEngagedWith(), boss_mekgineer_steamrigger::JustEngagedWith(), boss_warlord_kalithresh::JustEngagedWith(), boss_ghazan::JustEngagedWith(), boss_hungarfen::JustEngagedWith(), boss_swamplord_muselek::JustEngagedWith(), boss_the_black_stalker::JustEngagedWith(), npc_underbat::JustEngagedWith(), boss_gruul::JustEngagedWith(), boss_high_king_maulgar::JustEngagedWith(), boss_olm_the_summoner::JustEngagedWith(), boss_kiggler_the_crazed::JustEngagedWith(), boss_blindeye_the_seer::JustEngagedWith(), boss_krosh_firehand::JustEngagedWith(), boss_kelidan_the_breaker::JustEngagedWith(), boss_the_maker::JustEngagedWith(), boss_omor_the_unscarred::JustEngagedWith(), boss_nazan::JustEngagedWith(), boss_vazruden::JustEngagedWith(), boss_watchkeeper_gargolmar::JustEngagedWith(), boss_dalliah_the_doomsayer::JustEngagedWith(), boss_harbinger_skyriss::JustEngagedWith(), boss_zereketh_the_unbound::JustEngagedWith(), boss_commander_sarannis::JustEngagedWith(), boss_high_botanist_freywinn::JustEngagedWith(), boss_laj::JustEngagedWith(), boss_thorngrin_the_tender::JustEngagedWith(), boss_warp_splinter::JustEngagedWith(), boss_gatewatcher_gyrokill::JustEngagedWith(), boss_gatewatcher_iron_hand::JustEngagedWith(), boss_mechano_lord_capacitus::JustEngagedWith(), boss_nethermancer_sepethrea::JustEngagedWith(), boss_pathaleon_the_calculator::JustEngagedWith(), boss_curator::JustEngagedWith(), boss_maiden_of_virtue::JustEngagedWith(), boss_midnight::JustEngagedWith(), boss_moroes::JustEngagedWith(), boss_netherspite::JustEngagedWith(), npc_ohgan::npc_ohganAI::JustEngagedWith(), npc_hivezara_stinger::JustEngagedWith(), boss_kri::JustEngagedWith(), boss_vem::JustEngagedWith(), boss_yauj::JustEngagedWith(), boss_fankriss::JustEngagedWith(), boss_twinemperorsAI::JustEngagedWith(), boss_veknilash::JustEngagedWith(), boss_veklor::JustEngagedWith(), npc_vekniss_stinger::JustEngagedWith(), boss_murmur::JustEngagedWith(), boss_magtheridon::JustEngagedWith(), boss_grand_warlock_nethekurse::JustEngagedWith(), boss_porung::JustEngagedWith(), boss_warchief_kargath_bladefist::JustEngagedWith(), boss_gruul::KilledUnit(), boss_high_king_maulgar::KilledUnit(), boss_omor_the_unscarred::KilledUnit(), boss_vazruden::KilledUnit(), boss_watchkeeper_gargolmar::KilledUnit(), boss_magtheridon::KilledUnit(), boss_moroes::KilledUnit(), boss_ayamiss::MovementInform(), boss_bug_trio::MovementInform(), boss_nazan::MovementInform(), boss_servant_quarters::MovementInform(), npc_shattered_hand_scout::MovementInform(), boss_warchief_kargath_bladefist::MovementInform(), instance_ruins_of_ahnqiraj::instance_ruins_of_ahnqiraj_InstanceMapScript::OnUnitDeath(), instance_temple_of_ahnqiraj::instance_temple_of_ahnqiraj_InstanceMapScript::OnUnitDeath(), boss_malchezaar::Reset(), boss_julianne::Reset(), npc_apothecary_baxter::Reset(), go_direbrew_mole_machine::go_direbrew_mole_machineAI::Reset(), go_sand_trap::Reset(), npc_eye_tentacle::Reset(), npc_claw_tentacle::Reset(), npc_giant_claw_tentacle::Reset(), npc_giant_eye_tentacle::Reset(), npc_ahnqiraji_critter::Reset(), boss_exarch_maladaar::Reset(), npc_stolen_soul::Reset(), boss_talon_king_ikiss::Reset(), npc_voidtraveler::Reset(), boss_hungarfen::Reset(), boss_high_king_maulgar::Reset(), boss_omor_the_unscarred::Reset(), boss_watchkeeper_gargolmar::Reset(), boss_magtheridon::Reset(), npc_injured_patient::npc_injured_patientAI::Reset(), Schedule(), boss_dorothee::ScheduleActivation(), boss_julianne::ScheduleCombat(), boss_magtheridon::ScheduleCombatEvents(), npc_dream_fog::npc_dream_fogAI::ScheduleEvents(), boss_nightbane::ScheduleFly(), boss_nightbane::ScheduleGround(), instance_the_black_morass::instance_the_black_morass_InstanceMapScript::ScheduleNextPortal(), boss_baroness_anastari::boss_baroness_anastariAI::SchedulePossession(), boss_commander_sarannis::ScheduleReinforcements(), boss_eye_of_cthun::ScheduleTask(), npc_giant_claw_tentacle::ScheduleTasks(), boss_attumen::ScheduleTasks(), boss_ayamiss::ScheduleTasks(), boss_cthun::ScheduleTasks(), instance_the_black_morass::instance_the_black_morass_InstanceMapScript::SetBossState(), boss_grand_warlock_nethekurse::SetData(), instance_ruins_of_ahnqiraj::instance_ruins_of_ahnqiraj_InstanceMapScript::SetData(), npc_warchief_portal::SetData(), boss_thekal::boss_thekalAI::SetData(), World::ShutdownServ(), npc_netherspite_infernal::SpellHit(), boss_terestian_illhoof::SpellHit(), boss_julianne::SpellHit(), boss_cthun::SummonedCreatureDies(), npc_drakonid_spawner::SummonedCreatureDies(), boss_warchief_kargath_bladefist::SummonedCreatureDies(), boss_netherspite::SwitchToBanishPhase(), boss_netherspite::SwitchToPortalPhase(), boss_nightbane::TakeOff(), boss_shade_of_aran::TriggerArcaneCooldown(), boss_shade_of_aran::TriggerFireCooldown(), boss_shade_of_aran::TriggerFrostCooldown(), and boss_dorothee::UpdateAI().
|
inline |
Schedule an event with a fixed rate. Never call this from within a task context! Use TaskContext::Schedule instead!
References RandomDurationBetween(), and Schedule().
|
inline |
Schedule an event with a randomized rate between min and max rate. Never call this from within a task context! Use TaskContext::Schedule instead!
References RandomDurationBetween(), and Schedule().
|
inlineprivate |
Schedule an event with a fixed rate. Never call this from within a task context! Use TaskContext::schedule instead!
References InsertTask().
|
inlineprivate |
References InsertTask().
Referenced by Schedule(), and TaskContext::Schedule().
|
inline |
Sets a validator which is asked if tasks are allowed to be executed.
References _predicate.
Referenced by boss_anzu::boss_anzu(), boss_apothecary_hummel::boss_apothecary_hummelAI::boss_apothecary_hummelAI(), boss_azuregos::boss_azuregosAI::boss_azuregosAI(), boss_bigbadwolf::boss_bigbadwolf(), boss_blackheart_the_inciter::boss_blackheart_the_inciter(), boss_blindeye_the_seer::boss_blindeye_the_seer(), boss_captain_skarloc::boss_captain_skarloc(), boss_darkweaver_syth::boss_darkweaver_syth(), boss_dorothee::boss_dorothee(), boss_epoch_hunter::boss_epoch_hunter(), boss_exarch_maladaar::boss_exarch_maladaar(), boss_gatewatcher_gyrokill::boss_gatewatcher_gyrokill(), boss_gatewatcher_iron_hand::boss_gatewatcher_iron_hand(), boss_ghazan::boss_ghazan(), boss_grand_warlock_nethekurse::boss_grand_warlock_nethekurse(), boss_harbinger_skyriss::boss_harbinger_skyriss(), boss_high_king_maulgar::boss_high_king_maulgar(), boss_jarien::boss_jarien(), boss_kelidan_the_breaker::boss_kelidan_the_breaker(), boss_kiggler_the_crazed::boss_kiggler_the_crazed(), boss_krosh_firehand::boss_krosh_firehand(), boss_lieutenant_drake::boss_lieutenant_drake(), boss_magtheridon::boss_magtheridon(), boss_maiden_of_virtue::boss_maiden_of_virtue(), boss_mechano_lord_capacitus::boss_mechano_lord_capacitus(), boss_mekgineer_steamrigger::boss_mekgineer_steamrigger(), boss_mennu_the_betrayer::boss_mennu_the_betrayer(), boss_mor_grayhoof::boss_mor_grayhoof(), boss_moroes::boss_moroes(), boss_murmur::boss_murmur(), boss_nazan::boss_nazan(), boss_nethermancer_sepethrea::boss_nethermancer_sepethrea(), boss_nexusprince_shaffar::boss_nexusprince_shaffar(), boss_nightbane::boss_nightbane(), boss_olm_the_summoner::boss_olm_the_summoner(), boss_omor_the_unscarred::boss_omor_the_unscarred(), boss_ouro::boss_ouro(), boss_pandemonius::boss_pandemonius(), boss_pathaleon_the_calculator::boss_pathaleon_the_calculator(), boss_quagmirran::boss_quagmirran(), boss_roar::boss_roar(), boss_rokmar_the_crackler::boss_rokmar_the_crackler(), boss_shade_of_aran::boss_shade_of_aran(), boss_shirrak_the_dead_watcher::boss_shirrak_the_dead_watcher(), boss_sothos::boss_sothos(), boss_strawman::boss_strawman(), boss_swamplord_muselek::boss_swamplord_muselek(), boss_talon_king_ikiss::boss_talon_king_ikiss(), boss_tavarok::boss_tavarok(), boss_terestian_illhoof::boss_terestian_illhoof(), boss_the_black_stalker::boss_the_black_stalker(), boss_the_maker::boss_the_maker(), boss_thorngrin_the_tender::boss_thorngrin_the_tender(), boss_tinhead::boss_tinhead(), boss_twinemperorsAI::boss_twinemperorsAI(), boss_vazruden::boss_vazruden(), boss_warbringer_omrogg::boss_warbringer_omrogg(), boss_warchief_kargath_bladefist::boss_warchief_kargath_bladefist(), boss_watchkeeper_gargolmar::boss_watchkeeper_gargolmar(), boss_wrath_scryer_soccothrates::boss_wrath_scryer_soccothrates(), boss_zereketh_the_unbound::boss_zereketh_the_unbound(), npc_coren_direbrew_sisters::JustEngagedWith(), npc_apothecary_baxter::npc_apothecary_baxter(), npc_aran_elemental::npc_aran_elemental(), npc_batrider::npc_batrider(), npc_icc_spire_frostwyrm::npc_icc_spire_frostwyrm(), boss_kormok::Reset(), boss_baroness_anastari::boss_baroness_anastariAI::Reset(), npc_ohgan::npc_ohganAI::Reset(), boss_thekal::boss_thekalAI::Reset(), npc_zealot_lorkhan::npc_zealot_lorkhanAI::Reset(), npc_zealot_zath::npc_zealot_zathAI::Reset(), boss_isalien::Reset(), and npc_anubisath_guardian::Reset().
TaskScheduler & TaskScheduler::Update | ( | size_t const | milliseconds, |
success_t const & | callback = EmptyCallback |
||
) |
Update the scheduler with a difftime in ms. Calls the optional callback on successfully finish.
References Update().
|
inline |
Update the scheduler with a difftime. Calls the optional callback on successfully finish.
References _now, and Dispatch().
TaskScheduler & TaskScheduler::Update | ( | success_t const & | callback = EmptyCallback | ) |
Update the scheduler to the current time. Calls the optional callback on successfully finish.
References _now, and Dispatch().
Referenced by Update(), World::Update(), instance_ruins_of_ahnqiraj::instance_ruins_of_ahnqiraj_InstanceMapScript::Update(), go_sand_trap::UpdateAI(), BossAI::UpdateAI(), boss_mor_grayhoof::UpdateAI(), npc_drakonid_spawner::UpdateAI(), npc_lava_spawn::UpdateAI(), boss_curator::UpdateAI(), boss_midnight::UpdateAI(), boss_moroes::UpdateAI(), boss_netherspite::UpdateAI(), boss_nightbane::UpdateAI(), npc_netherspite_infernal::UpdateAI(), npc_malchezaar_axe::UpdateAI(), boss_servant_quarters::UpdateAI(), npc_aran_elemental::UpdateAI(), npc_kilrek::UpdateAI(), npc_fiendish_imp::UpdateAI(), boss_terestian_illhoof::UpdateAI(), boss_dorothee::UpdateAI(), npc_tito::UpdateAI(), boss_roar::UpdateAI(), boss_strawman::UpdateAI(), boss_tinhead::UpdateAI(), boss_crone::UpdateAI(), npc_cyclone::UpdateAI(), boss_bigbadwolf::UpdateAI(), boss_julianne::UpdateAI(), boss_kormok::UpdateAI(), boss_apothecary_hummel::boss_apothecary_hummelAI::UpdateAI(), npc_apothecary_baxter::UpdateAI(), boss_baroness_anastari::boss_baroness_anastariAI::UpdateAI(), boss_jarien::UpdateAI(), boss_sothos::UpdateAI(), boss_twilight_corrupter::UpdateAI(), npc_batrider::UpdateAI(), boss_jindo::UpdateAI(), npc_healing_ward::UpdateAI(), npc_shade_of_jindo::UpdateAI(), npc_ohgan::npc_ohganAI::UpdateAI(), npc_vilebranch_speaker::UpdateAI(), npc_spawn_of_marli::UpdateAI(), boss_thekal::boss_thekalAI::UpdateAI(), npc_zealot_lorkhan::npc_zealot_lorkhanAI::UpdateAI(), npc_zealot_zath::npc_zealot_zathAI::UpdateAI(), npc_coren_direbrew_sisters::UpdateAI(), go_direbrew_mole_machine::go_direbrew_mole_machineAI::UpdateAI(), npc_hallows_end_soh::UpdateAI(), boss_azuregos::boss_azuregosAI::UpdateAI(), boss_epoch_hunter::UpdateAI(), boss_lieutenant_drake::UpdateAI(), boss_isalien::UpdateAI(), boss_ayamiss::UpdateAI(), npc_anubisath_guardian::UpdateAI(), npc_hivezara_stinger::UpdateAI(), npc_obsidian_destroyer::UpdateAI(), boss_bug_trio::UpdateAI(), boss_cthun::UpdateAI(), npc_eye_tentacle::UpdateAI(), npc_claw_tentacle::UpdateAI(), npc_giant_eye_tentacle::UpdateAI(), boss_fankriss::UpdateAI(), boss_ouro::UpdateAI(), npc_dirt_mound::UpdateAI(), boss_twinemperorsAI::UpdateAI(), boss_viscidus::UpdateAI(), boss_glob_of_viscidus::UpdateAI(), npc_anubisath_defender::UpdateAI(), npc_vekniss_stinger::UpdateAI(), npc_anubisath_warder::UpdateAI(), npc_obsidian_nullifier::UpdateAI(), npc_ahnqiraji_critter::UpdateAI(), npc_icc_spire_frostwyrm::UpdateAI(), boss_exarch_maladaar::UpdateAI(), npc_stolen_soul::UpdateAI(), boss_nexusprince_shaffar::UpdateAI(), npc_yor::UpdateAI(), boss_anzu::UpdateAI(), boss_ambassador_hellmaw::UpdateAI(), boss_blackheart_the_inciter::UpdateAI(), boss_doomlord_kazzak::boss_doomlordkazzakAI::UpdateAI(), boss_doomwalker::boss_doomwalkerAI::UpdateAI(), boss_ghazan::UpdateAI(), boss_hungarfen::UpdateAI(), npc_underbog_mushroom::UpdateAI(), boss_the_black_stalker::UpdateAI(), npc_underbat::UpdateAI(), boss_gruul::UpdateAI(), boss_high_king_maulgar::UpdateAI(), boss_olm_the_summoner::UpdateAI(), boss_kiggler_the_crazed::UpdateAI(), boss_blindeye_the_seer::UpdateAI(), boss_krosh_firehand::UpdateAI(), boss_the_maker::UpdateAI(), boss_omor_the_unscarred::UpdateAI(), boss_nazan::UpdateAI(), boss_vazruden::UpdateAI(), boss_watchkeeper_gargolmar::UpdateAI(), boss_magtheridon::UpdateAI(), boss_grand_warlock_nethekurse::UpdateAI(), boss_warchief_kargath_bladefist::UpdateAI(), npc_warchief_portal::UpdateAI(), npc_raging_flames::UpdateAI(), npc_dream_fog::npc_dream_fogAI::UpdateAI(), and npc_injured_patient::npc_injured_patientAI::UpdateAI().
|
friend |
|
private |
Contains all asynchronous tasks which will be invoked at the next update tick.
Referenced by Async(), CancelAll(), and Dispatch().
|
private |
The current time point (now)
Referenced by Dispatch(), RescheduleAll(), RescheduleGroup(), Schedule(), and Update().
|
private |
Referenced by ClearValidator(), Dispatch(), and SetValidator().
|
private |
The Task Queue which contains all task objects.
Referenced by CancelAll(), CancelGroup(), DelayAll(), DelayGroup(), Dispatch(), InsertTask(), IsGroupScheduled(), RescheduleAll(), and RescheduleGroup().
|
private |
Contains a self reference to track if this object was deleted or not.
Referenced by Dispatch().