diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-06-13 16:36:03 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-06-13 16:36:03 +0200 |
| commit | 36332d2463cdb98171878ab8c836a875fe3493cc (patch) | |
| tree | 1d48b25f397963cbaa6ed08235d83f030f57de0a /src/server/scripts/Battlegrounds | |
| parent | a4206da069ea55d96c6f4e12fff157f22f01a594 (diff) | |
Core/Misc: Remove a bunch of code from headers
Diffstat (limited to 'src/server/scripts/Battlegrounds')
6 files changed, 11 insertions, 6 deletions
diff --git a/src/server/scripts/Battlegrounds/DeephaulRavine/battleground_deephaul_ravine.cpp b/src/server/scripts/Battlegrounds/DeephaulRavine/battleground_deephaul_ravine.cpp index 663a6170963..8be231534ab 100644 --- a/src/server/scripts/Battlegrounds/DeephaulRavine/battleground_deephaul_ravine.cpp +++ b/src/server/scripts/Battlegrounds/DeephaulRavine/battleground_deephaul_ravine.cpp @@ -743,7 +743,8 @@ struct battleground_deephaul_ravine : BattlegroundScript return false; } - void DoForLeaders(std::function<void(Creature*)> const& fn) const + template <std::invocable<Creature*> Action> + void DoForLeaders(Action const& fn) const { for (ObjectGuid const& guid : _leaderGUIDs) if (Creature* creature = battlegroundMap->GetCreature(guid)) diff --git a/src/server/scripts/Battlegrounds/EyeOfTheStorm/battleground_eye_of_the_storm.cpp b/src/server/scripts/Battlegrounds/EyeOfTheStorm/battleground_eye_of_the_storm.cpp index 3c8ef48438e..107b003fe78 100644 --- a/src/server/scripts/Battlegrounds/EyeOfTheStorm/battleground_eye_of_the_storm.cpp +++ b/src/server/scripts/Battlegrounds/EyeOfTheStorm/battleground_eye_of_the_storm.cpp @@ -367,7 +367,8 @@ struct battleground_eye_of_the_storm : BattlegroundScript return baseCount; } - void DoForFlagKeepers(std::function<void(Player*)> const& action) const + template <std::invocable<Player*> Action> + void DoForFlagKeepers(Action const& action) const { if (GameObject const* flag = battlegroundMap->GetGameObject(_flagGUID)) if (Player* carrier = ObjectAccessor::FindPlayer(flag->GetFlagCarrierGUID())) diff --git a/src/server/scripts/Battlegrounds/IsleOfConquest/battleground_isle_of_conquest.cpp b/src/server/scripts/Battlegrounds/IsleOfConquest/battleground_isle_of_conquest.cpp index 5d55df8d6b7..fb48e239129 100644 --- a/src/server/scripts/Battlegrounds/IsleOfConquest/battleground_isle_of_conquest.cpp +++ b/src/server/scripts/Battlegrounds/IsleOfConquest/battleground_isle_of_conquest.cpp @@ -339,7 +339,7 @@ struct battleground_isle_of_conquest : BattlegroundScript { BattlegroundScript::OnStart(); - auto gameobjectAction = [&](GuidVector const& guids, std::function<void(GameObject*)> const& action) -> void + auto gameobjectAction = [&]<std::invocable<GameObject*> Action>(GuidVector const& guids, Action const& action) -> void { for (ObjectGuid const& guid : guids) if (GameObject* gameObject = battlegroundMap->GetGameObject(guid)) diff --git a/src/server/scripts/Battlegrounds/SilvershardMines/battleground_silvershard_mines.cpp b/src/server/scripts/Battlegrounds/SilvershardMines/battleground_silvershard_mines.cpp index 30721e47425..e23de84bab0 100644 --- a/src/server/scripts/Battlegrounds/SilvershardMines/battleground_silvershard_mines.cpp +++ b/src/server/scripts/Battlegrounds/SilvershardMines/battleground_silvershard_mines.cpp @@ -715,7 +715,8 @@ public: } } - void DoForPlayersInControlZone(std::function<void(GameObject const*, Player*)> const& fn) const + template <std::invocable<GameObject const*, Player*> Action> + void DoForPlayersInControlZone(Action const& fn) const { if (GameObject const* controlZone = GetControlZone()) for (ObjectGuid const& playerGuid : *controlZone->GetInsidePlayers()) diff --git a/src/server/scripts/Battlegrounds/TwinPeaks/battleground_twin_peaks.cpp b/src/server/scripts/Battlegrounds/TwinPeaks/battleground_twin_peaks.cpp index 0a0b37e4a16..f71cf0e5017 100644 --- a/src/server/scripts/Battlegrounds/TwinPeaks/battleground_twin_peaks.cpp +++ b/src/server/scripts/Battlegrounds/TwinPeaks/battleground_twin_peaks.cpp @@ -190,7 +190,8 @@ struct battleground_twin_peaks : BattlegroundScript TriggerGameEvent(TwinPeaks::Events::StartBattle); } - void DoForFlagKeepers(std::function<void(Player*)> const& action) const + template <std::invocable<Player*> Action> + void DoForFlagKeepers(Action const& action) const { for (ObjectGuid flagGUID : _flags) if (GameObject const* flag = battlegroundMap->GetGameObject(flagGUID)) diff --git a/src/server/scripts/Battlegrounds/WarsongGulch/battleground_warsong_gulch.cpp b/src/server/scripts/Battlegrounds/WarsongGulch/battleground_warsong_gulch.cpp index be76b69abf1..f658211a1bf 100644 --- a/src/server/scripts/Battlegrounds/WarsongGulch/battleground_warsong_gulch.cpp +++ b/src/server/scripts/Battlegrounds/WarsongGulch/battleground_warsong_gulch.cpp @@ -227,7 +227,8 @@ struct battleground_warsong_gulch : BattlegroundScript battleground->RewardHonorToTeam(battleground->GetBonusHonorFromKill(_honorEndKills), HORDE); } - void DoForFlagKeepers(std::function<void(Player*)> const& action) const + template <std::invocable<Player*> Action> + void DoForFlagKeepers(Action const& action) const { for (ObjectGuid flagGUID : _flags) if (GameObject const* flag = battlegroundMap->GetGameObject(flagGUID)) |
