1
0

Exported cScoreboard::ForEachObjective

This commit is contained in:
andrew
2014-03-01 14:03:16 +02:00
parent 5c44945287
commit a28e5eca18
4 changed files with 44 additions and 4 deletions

View File

@@ -457,7 +457,7 @@ cObjective * cScoreboard::GetObjectiveIn(eDisplaySlot a_Slot)
void cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, cObjectiveCallback& a_Callback)
bool cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, cObjectiveCallback& a_Callback)
{
cCSLock Lock(m_CSObjectives);
@@ -468,10 +468,30 @@ void cScoreboard::ForEachObjectiveWith(cObjective::eType a_Type, cObjectiveCallb
// Call callback
if (a_Callback.Item(&it->second))
{
return;
return false;
}
}
}
return true;
}
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))
{
return false;
}
}
return true;
}