Core/Maps: Add Map::DoOnPlayers helper function

Port From (https://github.com/TrinityCore/TrinityCore/commit/543a7b79c3e5259ed3da413a6d91f00dfd85977e)
This commit is contained in:
hondacrx
2022-05-09 13:23:28 -04:00
parent 94eea137ae
commit ac97b9b15b
2 changed files with 28 additions and 57 deletions
+6
View File
@@ -3814,6 +3814,12 @@ namespace Game.Maps
i_worldObjects.Remove(obj);
}
public void DoOnPlayers(Action<Player> action)
{
foreach (var player in GetPlayers())
action(player);
}
public List<Player> GetPlayers()
{
return m_activePlayers;