fix(Scripts/ShadowLabyrinth): Update Murmur script (#15970)

Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com>
This commit is contained in:
Skjalf
2023-04-17 00:19:12 -03:00
committed by GitHub
parent 8aa2a2ac0f
commit 5dcea531b5
6 changed files with 238 additions and 157 deletions

View File

@@ -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();

View File

@@ -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)