summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/StatSerializer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/WorldStorage/StatSerializer.h')
-rw-r--r--src/WorldStorage/StatSerializer.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/WorldStorage/StatSerializer.h b/src/WorldStorage/StatSerializer.h
new file mode 100644
index 000000000..43514465b
--- /dev/null
+++ b/src/WorldStorage/StatSerializer.h
@@ -0,0 +1,53 @@
+
+// StatSerializer.h
+
+// Declares the cStatSerializer class that is used for saving stats into JSON
+
+
+
+
+
+#pragma once
+
+#include "json/json.h"
+
+
+
+
+
+// fwd:
+class cStatManager;
+
+
+
+
+class cStatSerializer
+{
+public:
+
+ cStatSerializer(const AString& a_WorldName, const AString& a_PlayerName, cStatManager* a_Manager);
+
+ bool Load(void);
+
+ bool Save(void);
+
+
+protected:
+
+ void SaveStatToJSON(Json::Value & a_Out);
+
+ bool LoadStatFromJSON(const Json::Value & a_In);
+
+
+private:
+
+ cStatManager* m_Manager;
+
+ AString m_Path;
+
+
+} ;
+
+
+
+