OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
statemanagerimp.hpp
Go to the documentation of this file.
1 #ifndef GAME_STATE_STATEMANAGER_H
2 #define GAME_STATE_STATEMANAGER_H
3 
4 #include <map>
5 
6 #include "../mwbase/statemanager.hpp"
7 
8 #include <boost/filesystem/path.hpp>
9 
10 #include "charactermanager.hpp"
11 
12 namespace MWState
13 {
15  {
20  double mTimePlayed;
21 
22  private:
23 
24  void cleanup (bool force = false);
25 
26  bool verifyProfile (const ESM::SavedGame& profile) const;
27 
28  void writeScreenshot (std::vector<char>& imageData) const;
29 
30  std::map<int, int> buildContentFileIndexMap (const ESM::ESMReader& reader) const;
31 
32  public:
33 
34  StateManager (const boost::filesystem::path& saves, const std::string& game);
35 
36  virtual void requestQuit();
37 
38  virtual bool hasQuitRequest() const;
39 
40  virtual void askLoadRecent();
41 
42  virtual State getState() const;
43 
44  virtual void newGame (bool bypass = false);
48 
49  virtual void endGame();
50 
51  virtual void deleteGame (const MWState::Character *character, const MWState::Slot *slot);
53 
54  virtual void saveGame (const std::string& description, const Slot *slot = 0);
58 
60 
62  virtual void quickSave(std::string name = "Quicksave");
63 
65 
66  virtual void quickLoad();
67 
68  virtual void loadGame (const std::string& filepath);
72 
73  virtual void loadGame (const Character *character, const std::string &filepath);
75 
76  virtual Character *getCurrentCharacter ();
78 
82 
84 
85  virtual void update (float duration);
86  };
87 }
88 
89 #endif
std::map< int, int > buildContentFileIndexMap(const ESM::ESMReader &reader) const
Definition: statemanagerimp.cpp:64
void writeScreenshot(std::vector< char > &imageData) const
Definition: statemanagerimp.cpp:633
virtual void requestQuit()
Definition: statemanagerimp.cpp:95
Definition: character.hpp:19
Definition: esmreader.hpp:21
std::list< MWState::Character >::const_iterator CharacterIterator
Definition: statemanager.hpp:27
virtual void askLoadRecent()
Definition: statemanagerimp.cpp:105
Definition: savedgame.hpp:14
virtual State getState() const
Definition: statemanagerimp.cpp:133
CharacterManager mCharacterManager
Definition: statemanagerimp.hpp:19
virtual bool hasQuitRequest() const
Definition: statemanagerimp.cpp:100
Definition: statemanagerimp.hpp:14
virtual void loadGame(const std::string &filepath)
Definition: statemanagerimp.cpp:343
State mState
Definition: statemanagerimp.hpp:18
StateManager()
Definition: statemanager.hpp:39
Interface for game state manager (implemented in MWState)
Definition: statemanager.hpp:16
State
Definition: statemanager.hpp:20
virtual void newGame(bool bypass=false)
Definition: statemanagerimp.cpp:138
virtual void quickLoad()
Loads the last saved file.
Definition: statemanagerimp.cpp:551
virtual Character * getCurrentCharacter()
Definition: statemanagerimp.cpp:566
virtual void endGame()
Definition: statemanagerimp.cpp:169
virtual CharacterIterator characterBegin()
Definition: statemanagerimp.cpp:571
double mTimePlayed
Definition: statemanagerimp.hpp:20
void cleanup(bool force=false)
Definition: statemanagerimp.cpp:43
bool verifyProfile(const ESM::SavedGame &profile) const
Definition: statemanagerimp.cpp:606
bool mAskLoadRecent
Definition: statemanagerimp.hpp:17
bool mQuitRequest
Definition: statemanagerimp.hpp:16
virtual void deleteGame(const MWState::Character *character, const MWState::Slot *slot)
Delete a saved game slot from this character. If all save slots are deleted, the character will be de...
Definition: statemanagerimp.cpp:561
virtual void saveGame(const std::string &description, const Slot *slot=0)
Definition: statemanagerimp.cpp:174
virtual CharacterIterator characterEnd()
Definition: statemanagerimp.cpp:576
virtual void update(float duration)
Definition: statemanagerimp.cpp:581
Definition: charactermanager.hpp:10
Definition: character.hpp:10
virtual void quickSave(std::string name="Quicksave")
Saves a file, using supplied filename, overwritting if needed.
Definition: statemanagerimp.cpp:316
const char * name
Definition: crashcatcher.cpp:59