feat(Core/Battleground): rework bg queue system (#10817)

This commit is contained in:
Kargatum
2022-03-16 00:36:49 +07:00
committed by GitHub
parent 6c60dc3841
commit 78bdc89881
29 changed files with 1354 additions and 963 deletions

View File

@@ -2189,6 +2189,11 @@ ObjectGuid Group::GetLeaderGUID() const
return m_leaderGuid;
}
Player* Group::GetLeader()
{
return ObjectAccessor::FindConnectedPlayer(m_leaderGuid);
}
ObjectGuid Group::GetGUID() const
{
return m_guid;
@@ -2425,3 +2430,15 @@ void Group::SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
_difficultyChangePreventionTime = GameTime::GetGameTime().count() + MINUTE;
_difficultyChangePreventionType = type;
}
void Group::DoForAllMembers(std::function<void(Player*)> const& worker)
{
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* member = itr->GetSource();
if (!member)
continue;
worker(member);
}
}