/********************************************************************
*
* Created: 28/3/2014 10:20
*
* File: fsCGlobalSavedData.h
*
* Author: Mick Waites
*
* Purpose: Centralised player profile information and global
* settings.
*
*********************************************************************/
#ifndef fsCGlobalSavedDatahdr
#define fsCGlobalSavedDatahdr
#include <memory>
#include <fsCore/src/fsCResourceName.h>
#include "../fsISavedData.h"
class fsCGlobalSavedData : public fsISavedData
{
friend class fsCProfileManager;
friend class fsCAppCoreMain;
public:
static const fsS32 mNoProfileLoaded = -1;
static const fsStr mCurrentLocale;
fsStr uniqueIDGet() const;
fsStr currentLocaleGet() const;
void currentLocaleSet(fsStr const& pLocale);
void appRunningtTimeSet(fsS32 pAppRunningTime);
fsS32 appRunningtTimeGet() const;
fsS32 numProfilesGet() const;
fsS32 currentProfileIndexGet() const;
fsStr profileNameGet(fsS32 pProfileIndex) const;
fsCResourceName profileFileNameGet(fsS32 pProfileIndex) const;
fsStr profileChapterGet(fsS32 pProfileIndex) const;
fsS32 profileGameModeGet(fsS32 pProfileIndex) const;
virtual ~fsCGlobalSavedData();<--- Destructor in derived class
static std::unique_ptr<fsCGlobalSavedData> create();
protected:
void uniqueIDSet(const fsStr& pID);
void currentProfileIndexSet(fsS32 pProfileIndex);
void numProfilesSet(fsS32 pNumProfiles);
void resetToDefaultsDo() override;
fsCGlobalSavedData();
private:
#if defined fsInAppPurchaseProcess
static const fsStr mPurchasedPayWallKey;
#endif
static const fsStr mNumProfilesKey;
static const fsStr mCurrentProfileIndexKey;
static const fsStr mProfileNameKey;
static const fsStr mProfileFileNameKey;
static const fsStr mProfileChapterKey;
static const fsStr mProfileGameModeKey;
static const fsStr mUniqueIDKey;
static const fsStr mAppRunningTime;
};
#endif