1
0
cuberite-2a/src/WorldStorage/StatSerializer.h

48 lines
654 B
C
Raw Normal View History

2014-05-11 07:57:06 -04:00
// StatSerializer.h
// Declares the cStatSerializer class that is used for saving stats into JSON
#pragma once
// fwd:
class cStatManager;
namespace Json { class Value; }
2014-05-11 07:57:06 -04:00
class cStatSerializer
{
public:
2020-08-19 08:09:39 -04:00
cStatSerializer(cStatManager & Manager, const std::string & WorldPath, std::string FileName);
2014-05-11 07:57:06 -04:00
/* Try to load the player statistics. */
void Load(void);
2014-05-11 07:57:06 -04:00
/* Try to save the player statistics. */
void Save(void);
2014-05-11 07:57:06 -04:00
private:
2014-05-11 07:57:06 -04:00
void SaveStatToJSON(Json::Value & a_Out);
2020-08-19 08:09:39 -04:00
void LoadLegacyFromJSON(const Json::Value & In);
void LoadCustomStatFromJSON(const Json::Value & a_In);
2014-05-11 07:57:06 -04:00
cStatManager & m_Manager;
2014-05-11 07:57:06 -04:00
2020-08-19 08:09:39 -04:00
std::string m_Path;
2014-05-11 07:57:06 -04:00
} ;