BVB Source Codes

CRYENGINE Show ICheckPointSystem.h Source code

Return Download CRYENGINE: download ICheckPointSystem.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.  
  6.    Description:
  7.    Interface for the Check Point System
  8.  
  9.    -------------------------------------------------------------------------
  10.    History:
  11.    - 05:02:2009  : Created by Kevin Kirst
  12.  
  13. *************************************************************************/
  14.  
  15. #ifndef __ICHECKPOINTSYSTEM_H__
  16. #define __ICHECKPOINTSYSTEM_H__
  17.  
  18. typedef CryFixedStringT<32> FixedCheckpointString;
  19.  
  20. struct ICheckpointSystem;
  21.  
  22. //container for checkpoint metadata
  23. struct SCheckpointData
  24. {
  25.         int                   m_versionNumber;
  26.         EntityId              m_checkPointId;
  27.         FixedCheckpointString m_levelName;
  28.         FixedCheckpointString m_saveTime;
  29. };
  30.  
  31. //listener to onSave/onLoad events and interface for external save/load
  32. struct ICheckpointListener
  33. {
  34.         virtual ~ICheckpointListener(){}
  35.         // triggered at the end of saving
  36.         virtual void OnSave(SCheckpointData* pCheckpoint, ICheckpointSystem* pSystem) = 0;
  37.         // triggered at the end of loading
  38.         virtual void OnLoad(SCheckpointData* pCheckpoint, ICheckpointSystem* pSystem) = 0;
  39. };
  40.  
  41. //listener for game-specific processing of saving/loading
  42. struct ICheckpointGameHandler
  43. {
  44.         virtual ~ICheckpointGameHandler() {}
  45.  
  46.         // Writing game-specific data
  47.         virtual void OnWriteData(XmlNodeRef parentNode) {}
  48.  
  49.         // Reading game-specific data
  50.         virtual void OnReadData(XmlNodeRef parentNode) {}
  51.  
  52.         // Engine reset control
  53.         virtual void OnPreResetEngine()  {}
  54.         virtual void OnPostResetEngine() {}
  55.  
  56.         // Restart
  57.         virtual void OnRestartGameplay() {}
  58. };
  59.  
  60. //System interface
  61. struct ICheckpointSystem
  62. {
  63.         virtual ~ICheckpointSystem() {}
  64.  
  65.         //load last (during this session) saved checkpoint
  66.         virtual bool LoadLastCheckpoint() = 0;
  67.  
  68.         //load a game checkpoint from the specified filename
  69.         virtual bool LoadGame(const char* fileName) = 0;
  70.  
  71.         //save a game checkpoint with the specified filename
  72.         virtual bool SaveGame(EntityId checkpointId, const char* fileName) = 0;
  73.  
  74.         //set game handler
  75.         virtual void SetGameHandler(ICheckpointGameHandler* pHandler) = 0;
  76.  
  77.         //clear game handler
  78.         virtual void ClearGameHandler() = 0;
  79.  
  80.         //add checkpoint system listener
  81.         virtual void RegisterListener(ICheckpointListener* pListener) = 0;
  82.  
  83.         //remove checkpoint system listener
  84.         virtual void RemoveListener(ICheckpointListener* pListener) = 0;
  85.  
  86.         //save/load worldMatrix for an Entity
  87.         virtual void SerializeWorldTM(IEntity* pEntity, XmlNodeRef data, bool writing) = 0;
  88.  
  89.         // save a single, external entity position/orientation/status during "OnSave"
  90.         // the entity is loaded automatically with the checkpoint
  91.         virtual bool SaveExternalEntity(EntityId id) = 0;
  92. };
  93.  
  94. #endif //__ICHECKPOINTSYSTEM_H__
  95.  
downloadICheckPointSystem.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