summaryrefslogtreecommitdiffstats
path: root/src/Scoreboard.cpp
diff options
context:
space:
mode:
authorandrew <xdotftw@gmail.com>2014-03-01 13:27:55 +0100
committerandrew <xdotftw@gmail.com>2014-03-01 13:27:55 +0100
commit39c8e68ef030b70f1f50165e74d26100bc1988cc (patch)
treec99189a7f33d75f61b81cf0e8a2e8e7b5755236e /src/Scoreboard.cpp
parentShortened enums (diff)
downloadcuberite-39c8e68ef030b70f1f50165e74d26100bc1988cc.tar
cuberite-39c8e68ef030b70f1f50165e74d26100bc1988cc.tar.gz
cuberite-39c8e68ef030b70f1f50165e74d26100bc1988cc.tar.bz2
cuberite-39c8e68ef030b70f1f50165e74d26100bc1988cc.tar.lz
cuberite-39c8e68ef030b70f1f50165e74d26100bc1988cc.tar.xz
cuberite-39c8e68ef030b70f1f50165e74d26100bc1988cc.tar.zst
cuberite-39c8e68ef030b70f1f50165e74d26100bc1988cc.zip
Diffstat (limited to 'src/Scoreboard.cpp')
-rw-r--r--src/Scoreboard.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Scoreboard.cpp b/src/Scoreboard.cpp
index ee56a1145..05fd0314d 100644
--- a/src/Scoreboard.cpp
+++ b/src/Scoreboard.cpp
@@ -498,6 +498,25 @@ bool cScoreboard::ForEachObjective(cObjectiveCallback& a_Callback)
+bool cScoreboard::ForEachTeam(cTeamCallback& a_Callback)
+{
+ cCSLock Lock(m_CSObjectives);
+
+ for (cTeamMap::iterator it = m_Teams.begin(); it != m_Teams.end(); ++it)
+ {
+ // Call callback
+ if (a_Callback.Item(&it->second))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+
+
+
+
void cScoreboard::AddPlayerScore(const AString & a_Name, cObjective::eType a_Type, cObjective::Score a_Value)
{
cCSLock Lock(m_CSObjectives);