diff options
author | andrew <xdotftw@gmail.com> | 2014-03-01 13:03:16 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-03-01 13:03:16 +0100 |
commit | a28e5eca1835e1be868c3bcd22d87e3cfae2f547 (patch) | |
tree | 278c6e7ac3743414539944fd2df6420e1ec651ed /src/Scoreboard.cpp | |
parent | Exported and documented cScoreboard (diff) | |
download | cuberite-a28e5eca1835e1be868c3bcd22d87e3cfae2f547.tar cuberite-a28e5eca1835e1be868c3bcd22d87e3cfae2f547.tar.gz cuberite-a28e5eca1835e1be868c3bcd22d87e3cfae2f547.tar.bz2 cuberite-a28e5eca1835e1be868c3bcd22d87e3cfae2f547.tar.lz cuberite-a28e5eca1835e1be868c3bcd22d87e3cfae2f547.tar.xz cuberite-a28e5eca1835e1be868c3bcd22d87e3cfae2f547.tar.zst cuberite-a28e5eca1835e1be868c3bcd22d87e3cfae2f547.zip |
Diffstat (limited to 'src/Scoreboard.cpp')
-rw-r--r-- | src/Scoreboard.cpp | 24 |
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; } |