summaryrefslogtreecommitdiffstats
path: root/src/Scoreboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Scoreboard.cpp')
-rw-r--r--src/Scoreboard.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/Scoreboard.cpp b/src/Scoreboard.cpp
index 1c5a22eff..43b8ba1ad 100644
--- a/src/Scoreboard.cpp
+++ b/src/Scoreboard.cpp
@@ -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;
}