diff options
author | andrew <xdotftw@gmail.com> | 2014-01-21 14:58:17 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-01-21 14:58:17 +0100 |
commit | aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014 (patch) | |
tree | 42e227cd81bced9bc42b4f686753ccbde1b95caa /src/Scoreboard.h | |
parent | Scoreboard serialization (diff) | |
download | cuberite-aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014.tar cuberite-aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014.tar.gz cuberite-aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014.tar.bz2 cuberite-aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014.tar.lz cuberite-aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014.tar.xz cuberite-aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014.tar.zst cuberite-aa61f55b743a8ecf3cd8e1f99e1d9a0308f6d014.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Scoreboard.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Scoreboard.h b/src/Scoreboard.h index 2ce614de7..b92642a9a 100644 --- a/src/Scoreboard.h +++ b/src/Scoreboard.h @@ -14,6 +14,7 @@ class cObjective; +class cWorld; typedef cItemCallback<cObjective> cObjectiveCallback; @@ -54,7 +55,7 @@ public: public: - cObjective(const AString & a_Name, const AString & a_DisplayName, eType a_Type); + cObjective(const AString & a_Name, const AString & a_DisplayName, eType a_Type, cWorld * a_World); eType GetType(void) const { return m_Type; } @@ -79,6 +80,8 @@ public: /// Subtracts a_Delta and returns the new score Score SubScore(const AString & a_Name, Score a_Delta); + void SetDisplayName(const AString & a_Name); + private: typedef std::pair<AString, Score> cTrackedPlayer; @@ -92,6 +95,8 @@ private: eType m_Type; + cWorld * m_World; + friend class cScoreboardSerializer; }; @@ -180,7 +185,7 @@ public: public: - cScoreboard(); + cScoreboard(cWorld * a_World); /// Registers a new scoreboard objective, returns the cObjective instance, NULL on name collision cObjective * RegisterObjective(const AString & a_Name, const AString & a_DisplayName, cObjective::eType a_Type); @@ -223,10 +228,14 @@ private: typedef std::map<AString, cTeam> cTeamMap; // TODO 2014-01-19 xdot: Potential optimization - Sort objectives based on type + cCriticalSection m_CSObjectives; cObjectiveMap m_Objectives; + cCriticalSection m_CSTeams; cTeamMap m_Teams; + cWorld * m_World; + cObjective* m_Display[E_DISPLAY_SLOT_COUNT]; friend class cScoreboardSerializer; |