BVB Source Codes

CRYENGINE Show PlayerProfile.h Source code

Return Download CRYENGINE: download PlayerProfile.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __PLAYERPROFILE_H__
  4. #define __PLAYERPROFILE_H__
  5.  
  6. #if _MSC_VER > 1000
  7.         #pragma once
  8. #endif
  9.  
  10. //#include <IPlayerProfiles.h>
  11. #include "PlayerProfileManager.h"
  12.  
  13. class CPlayerProfile : public IPlayerProfile
  14. {
  15. public:
  16.         static const char* ATTRIBUTES_TAG; // "Attributes";
  17.         static const char* ACTIONMAPS_TAG; // "ActionMaps";
  18.         static const char* VERSION_TAG;    // "Version";
  19.  
  20.         typedef std::map<string, TFlowInputData, std::less<string>, stl::STLGlobalAllocator<std::pair<const string, TFlowInputData>>> TAttributeMap;
  21.  
  22.         CPlayerProfile(CPlayerProfileManager* pManager, const char* name, const char* userId, bool bIsPreview = false);
  23.         virtual ~CPlayerProfile();
  24.  
  25.         // IPlayerProfile
  26.         virtual bool Reset();
  27.  
  28.         // is this the default profile? it cannot be modified
  29.         virtual bool IsDefault() const;
  30.  
  31.         // override values with console player profile defaults
  32.         void LoadGamerProfileDefaults();
  33.  
  34.         // name of the profile
  35.         virtual const char* GetName();
  36.  
  37.         // Id of the profile user
  38.         virtual const char* GetUserId();
  39.  
  40.         // retrieve an action map
  41.         virtual IActionMap* GetActionMap(const char* name);
  42.  
  43.         // set the value of an attribute
  44.         virtual bool SetAttribute(const char* name, const TFlowInputData& value);
  45.  
  46.         // re-set attribute to default value (basically removes it from this profile)
  47.         virtual bool ResetAttribute(const char* name);
  48.  
  49.         //delete an attribute from attribute map (regardless if has a default)
  50.         virtual void DeleteAttribute(const char* name);
  51.  
  52.         // get the value of an attribute. if not specified optionally lookup in default profile
  53.         virtual bool GetAttribute(const char* name, TFlowInputData& val, bool bUseDefaultFallback = true) const;
  54.  
  55.         // get all attributes available
  56.         // all in this profile and inherited from default profile
  57.         virtual IAttributeEnumeratorPtr CreateAttributeEnumerator();
  58.  
  59.         // save game stuff
  60.         virtual ISaveGameEnumeratorPtr CreateSaveGameEnumerator();
  61.         virtual ISaveGame*             CreateSaveGame();
  62.         virtual ILoadGame*             CreateLoadGame();
  63.         virtual bool                   DeleteSaveGame(const char* name);
  64.         virtual ILevelRotationFile*    GetLevelRotationFile(const char* name);
  65.         // ~IPlayerProfile
  66.  
  67.         bool                 SerializeXML(CPlayerProfileManager::IProfileXMLSerializer* pSerializer);
  68.  
  69.         void                 SetName(const char* name);
  70.         void                 SetUserId(const char* userId);
  71.  
  72.         const TAttributeMap& GetAttributeMap() const
  73.         {
  74.                 return m_attributeMap;
  75.         }
  76.  
  77.         const TAttributeMap& GetDefaultAttributeMap() const;
  78.  
  79.         void                 GetMemoryStatistics(ICrySizer* s);
  80.  
  81. protected:
  82.         bool LoadAttributes(const XmlNodeRef& root, int requiredVersion);
  83.         bool SaveAttributes(const XmlNodeRef& root);
  84.  
  85.         friend class CAttributeEnumerator;
  86.  
  87.         CPlayerProfileManager* m_pManager;
  88.         string                 m_name;
  89.         string                 m_userId;
  90.         TAttributeMap          m_attributeMap;
  91.         int                    m_attributesVersion;
  92.         bool                   m_bIsPreview;
  93. };
  94.  
  95. #endif
  96.  
downloadPlayerProfile.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top