1
0

Revert "Replace ItemCallbacks with lambdas (#3948)"

This reverts commit 496c337cdf.
This commit is contained in:
LogicParrot
2017-09-02 10:45:06 +03:00
committed by Alexander Harkness
parent 700bbdabf5
commit 49c443896d
67 changed files with 1832 additions and 874 deletions

View File

@@ -1,4 +1,4 @@
// Scoreboard.cpp
// Implementation of a scoreboard that keeps track of specified objectives
@@ -487,7 +487,7 @@ cObjective * cScoreboard::GetObjectiveIn(eDisplaySlot a_Slot)
bool cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, const cObjectiveCallback & a_Callback)
bool cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, cObjectiveCallback & a_Callback)
{
cCSLock Lock(m_CSObjectives);
@@ -496,7 +496,7 @@ bool cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, const cObjectiv
if (it->second.GetType() == a_Type)
{
// Call callback
if (a_Callback(it->second))
if (a_Callback.Item(&it->second))
{
return false;
}
@@ -509,14 +509,14 @@ bool cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, const cObjectiv
bool cScoreboard::ForEachObjective(const cObjectiveCallback & a_Callback)
bool cScoreboard::ForEachObjective(cObjectiveCallback & a_Callback)
{
cCSLock Lock(m_CSObjectives);
for (cObjectiveMap::iterator it = m_Objectives.begin(); it != m_Objectives.end(); ++it)
{
// Call callback
if (a_Callback(it->second))
if (a_Callback.Item(&it->second))
{
return false;
}
@@ -528,14 +528,14 @@ bool cScoreboard::ForEachObjective(const cObjectiveCallback & a_Callback)
bool cScoreboard::ForEachTeam(const cTeamCallback & a_Callback)
bool cScoreboard::ForEachTeam(cTeamCallback & a_Callback)
{
cCSLock Lock(m_CSTeams);
for (cTeamMap::iterator it = m_Teams.begin(); it != m_Teams.end(); ++it)
{
// Call callback
if (a_Callback(it->second))
if (a_Callback.Item(&it->second))
{
return false;
}