diff options
author | andrew <xdotftw@gmail.com> | 2014-03-01 13:27:55 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-03-01 13:27:55 +0100 |
commit | 39c8e68ef030b70f1f50165e74d26100bc1988cc (patch) | |
tree | c99189a7f33d75f61b81cf0e8a2e8e7b5755236e /src/Scoreboard.cpp | |
parent | Shortened enums (diff) | |
download | cuberite-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 '')
-rw-r--r-- | src/Scoreboard.cpp | 19 |
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); |