summaryrefslogblamecommitdiffstats
path: root/src/WorldStorage/StatSerializer.h
blob: e6a5bd32528f4f04d480df8bb6454594901a021f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                                             





                   

                               







                     
                                                                                                           
 

                                                
 

                                                
 
        


                                                 
                                                              
 
                                 

                       
   

// StatSerializer.h

// Declares the cStatSerializer class that is used for saving stats into JSON





#pragma once





// fwd:
class cStatManager;
namespace Json { class Value; }





class cStatSerializer
{
public:

	cStatSerializer(cStatManager & a_Manager, const AString & a_WorldName, const AString & a_FileName);

	/* Try to load the player statistics. */
	void Load(void);

	/* Try to save the player statistics. */
	void Save(void);

private:

	void SaveStatToJSON(Json::Value & a_Out);

	void LoadCustomStatFromJSON(const Json::Value & a_In);

	cStatManager & m_Manager;

	AString m_Path;
} ;