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;
|
2020-08-12 04:54:36 -04:00
|
|
|
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
|
|
|
|
2020-08-12 04:54:36 -04:00
|
|
|
/* Try to load the player statistics. */
|
|
|
|
void Load(void);
|
2014-05-11 07:57:06 -04:00
|
|
|
|
2020-08-12 04:54:36 -04:00
|
|
|
/* Try to save the player statistics. */
|
|
|
|
void Save(void);
|
2014-05-11 07:57:06 -04:00
|
|
|
|
2020-08-12 04:54:36 -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);
|
|
|
|
|
2020-08-12 04:54:36 -04:00
|
|
|
void LoadCustomStatFromJSON(const Json::Value & a_In);
|
2014-05-11 07:57:06 -04:00
|
|
|
|
2020-08-12 04:54:36 -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
|
|
|
} ;
|