summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/StatSerializer.h
diff options
context:
space:
mode:
author12xx12 <44411062+12xx12@users.noreply.github.com>2020-08-12 10:54:36 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-19 21:45:27 +0200
commit7d0813ce8c1be14bc1b9b706644bd4aa797244ee (patch)
tree6d026a11be6db2da3d60b94b4f4a442460253e1d /src/WorldStorage/StatSerializer.h
parentAdd enhanced Gold generation in Mesa-Type Biomes (#4821) (diff)
downloadcuberite-7d0813ce8c1be14bc1b9b706644bd4aa797244ee.tar
cuberite-7d0813ce8c1be14bc1b9b706644bd4aa797244ee.tar.gz
cuberite-7d0813ce8c1be14bc1b9b706644bd4aa797244ee.tar.bz2
cuberite-7d0813ce8c1be14bc1b9b706644bd4aa797244ee.tar.lz
cuberite-7d0813ce8c1be14bc1b9b706644bd4aa797244ee.tar.xz
cuberite-7d0813ce8c1be14bc1b9b706644bd4aa797244ee.tar.zst
cuberite-7d0813ce8c1be14bc1b9b706644bd4aa797244ee.zip
Diffstat (limited to 'src/WorldStorage/StatSerializer.h')
-rw-r--r--src/WorldStorage/StatSerializer.h31
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;
-
-
} ;
-
-
-
-