1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwstate/statemanagerimp.hpp

71 lines
2.0 KiB
C++
Raw Normal View History

2013-11-16 09:31:46 +00:00
#ifndef GAME_STATE_STATEMANAGER_H
#define GAME_STATE_STATEMANAGER_H
#include <map>
2013-11-16 09:31:46 +00:00
#include "../mwbase/statemanager.hpp"
#include <boost/filesystem/path.hpp>
#include "charactermanager.hpp"
2013-11-16 09:31:46 +00:00
namespace MWState
{
class StateManager : public MWBase::StateManager
{
bool mQuitRequest;
2013-12-19 20:08:34 +00:00
bool mAskLoadRecent;
State mState;
CharacterManager mCharacterManager;
double mTimePlayed;
2013-11-28 10:22:34 +00:00
private:
void cleanup (bool force = false);
2013-11-28 10:22:34 +00:00
std::map<int, int> buildContentFileIndexMap (const ESM::ESMReader& reader) const;
2013-11-16 09:31:46 +00:00
public:
StateManager (const boost::filesystem::path& saves, const std::string& game);
2013-11-16 09:31:46 +00:00
virtual void requestQuit();
virtual bool hasQuitRequest() const;
2013-12-19 20:08:34 +00:00
virtual void askLoadRecent();
virtual State getState() const;
virtual void newGame (bool bypass = false);
///< Start a new game.
///
/// \param bypass Skip new game mechanics.
2013-11-18 14:38:08 +00:00
virtual void endGame();
virtual void saveGame (const std::string& description, const Slot *slot = 0);
///< Write a saved game to \a slot or create a new slot if \a slot == 0.
///
/// \note Slot must belong to the current character.
2013-11-21 11:24:24 +00:00
virtual void loadGame (const Character *character, const Slot *slot);
///< Load a saved game file from \a slot.
///
/// \note \a slot must belong to \a character.
2013-11-24 15:58:41 +00:00
virtual Character *getCurrentCharacter (bool create = true);
///< \param create Create a new character, if there is no current character.
virtual CharacterIterator characterBegin();
2013-11-21 11:29:24 +00:00
///< Any call to SaveGame and getCurrentCharacter can invalidate the returned
/// iterator.
virtual CharacterIterator characterEnd();
virtual void update (float duration);
2013-11-16 09:31:46 +00:00
};
}
#endif