1
0

Replace ItemCallbacks with lambdas (#3993)

This commit is contained in:
peterbell10
2017-09-11 22:20:49 +01:00
committed by Mattes D
parent 115bc5609a
commit e225b7f826
69 changed files with 919 additions and 1817 deletions

View File

@@ -487,7 +487,7 @@ cObjective * cScoreboard::GetObjectiveIn(eDisplaySlot a_Slot)
bool cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, 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, cObjectiveCallb
if (it->second.GetType() == a_Type)
{
// Call callback
if (a_Callback.Item(&it->second))
if (a_Callback(it->second))
{
return false;
}
@@ -509,14 +509,14 @@ bool cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, cObjectiveCallb
bool cScoreboard::ForEachObjective(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.Item(&it->second))
if (a_Callback(it->second))
{
return false;
}
@@ -528,14 +528,14 @@ bool cScoreboard::ForEachObjective(cObjectiveCallback & a_Callback)
bool cScoreboard::ForEachTeam(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.Item(&it->second))
if (a_Callback(it->second))
{
return false;
}