From ff2302ebd53453242175683587b19ae5de5d1aed Mon Sep 17 00:00:00 2001 From: andrew Date: Mon, 20 Jan 2014 16:45:40 +0200 Subject: Scoreboard serialization --- src/Scoreboard.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/Scoreboard.h') diff --git a/src/Scoreboard.h b/src/Scoreboard.h index f7285a9cf..2ce614de7 100644 --- a/src/Scoreboard.h +++ b/src/Scoreboard.h @@ -54,10 +54,11 @@ public: public: - cObjective(const AString & a_DisplayName, eType a_Type); + cObjective(const AString & a_Name, const AString & a_DisplayName, eType a_Type); eType GetType(void) const { return m_Type; } + const AString & GetName(void) const { return m_Name; } const AString & GetDisplayName(void) const { return m_DisplayName; } /// Resets the objective @@ -80,16 +81,19 @@ public: private: - typedef std::pair TrackedPlayer; + typedef std::pair cTrackedPlayer; - typedef std::map ScoreMap; + typedef std::map cScoreMap; - ScoreMap m_Scores; + cScoreMap m_Scores; AString m_DisplayName; + AString m_Name; eType m_Type; + friend class cScoreboardSerializer; + }; @@ -152,6 +156,8 @@ private: cPlayerNameSet m_Players; + friend class cScoreboardSerializer; + }; @@ -198,7 +204,7 @@ public: void SetDisplay(const AString & a_Objective, eDisplaySlot a_Slot); - cObjective* GetObjectiveIn(eDisplaySlot a_Slot); + cObjective * GetObjectiveIn(eDisplaySlot a_Slot); /// Execute callback for each objective with the specified type void ForEachObjectiveWith(cObjective::eType a_Type, cObjectiveCallback& a_Callback); @@ -223,6 +229,8 @@ private: cObjective* m_Display[E_DISPLAY_SLOT_COUNT]; + friend class cScoreboardSerializer; + } ; -- cgit v1.2.3