mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
fix(Scripts/ShadowLabyrinth): Update Murmur script (#15970)
Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com>
This commit is contained in:
@@ -107,6 +107,11 @@ void TaskScheduler::Dispatch(success_t const& callback)
|
||||
callback();
|
||||
}
|
||||
|
||||
bool TaskScheduler::IsGroupScheduled(group_t const group)
|
||||
{
|
||||
return _task_holder.IsGroupQueued(group);
|
||||
}
|
||||
|
||||
void TaskScheduler::TaskQueue::Push(TaskContainer&& task)
|
||||
{
|
||||
container.insert(task);
|
||||
@@ -159,6 +164,19 @@ void TaskScheduler::TaskQueue::ModifyIf(std::function<bool(TaskContainer const&)
|
||||
container.insert(cache.begin(), cache.end());
|
||||
}
|
||||
|
||||
bool TaskScheduler::TaskQueue::IsGroupQueued(group_t const group)
|
||||
{
|
||||
for (auto const& task : container)
|
||||
{
|
||||
if (task->IsInGroup(group))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TaskScheduler::TaskQueue::IsEmpty() const
|
||||
{
|
||||
return container.empty();
|
||||
|
||||
@@ -136,6 +136,9 @@ class TaskScheduler
|
||||
|
||||
void ModifyIf(std::function<bool(TaskContainer const&)> const& filter);
|
||||
|
||||
/// Check if the group exists and is currently scheduled.
|
||||
bool IsGroupQueued(group_t const group);
|
||||
|
||||
bool IsEmpty() const;
|
||||
};
|
||||
|
||||
@@ -260,6 +263,9 @@ public:
|
||||
/// Hint: Use std::initializer_list for this: "{1, 2, 3, 4}"
|
||||
TaskScheduler& CancelGroupsOf(std::vector<group_t> const& groups);
|
||||
|
||||
/// Check if the group exists and is currently scheduled.
|
||||
bool IsGroupScheduled(group_t const group);
|
||||
|
||||
/// Delays all tasks with the given duration.
|
||||
template<class _Rep, class _Period>
|
||||
TaskScheduler& DelayAll(std::chrono::duration<_Rep, _Period> const& duration)
|
||||
|
||||
Reference in New Issue
Block a user