diff options
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/StatSerializer.h | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/src/WorldStorage/StatSerializer.h b/src/WorldStorage/StatSerializer.h index 8e8e4ffdb..e6a5bd325 100644 --- a/src/WorldStorage/StatSerializer.h +++ b/src/WorldStorage/StatSerializer.h @@ -9,14 +9,14 @@ #pragma once -#include "json/json.h" - // fwd: class cStatManager; +namespace Json { class Value; } + @@ -25,32 +25,21 @@ class cStatSerializer { public: - cStatSerializer(const AString & a_WorldName, const AString & a_PlayerName, const AString & a_FileName, cStatManager * a_Manager); + cStatSerializer(cStatManager & a_Manager, const AString & a_WorldName, const AString & a_FileName); - /* Try to load the player statistics. Returns whether the operation was successful or not. */ - bool Load(void); + /* Try to load the player statistics. */ + void Load(void); - /* Try to save the player statistics. Returns whether the operation was successful or not. */ - bool Save(void); + /* Try to save the player statistics. */ + void Save(void); - -protected: +private: void SaveStatToJSON(Json::Value & a_Out); - bool LoadStatFromJSON(const Json::Value & a_In); - - -private: + void LoadCustomStatFromJSON(const Json::Value & a_In); - cStatManager * m_Manager; + cStatManager & m_Manager; - AString m_LegacyPath; // The old <username>.json path to try to read from if the uuid path doesn't exist on load AString m_Path; - - } ; - - - - |