OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MWState::StateManager Class Reference

#include <statemanagerimp.hpp>

Inheritance diagram for MWState::StateManager:
Collaboration diagram for MWState::StateManager:

Public Member Functions

 StateManager (const boost::filesystem::path &saves, const std::string &game)
 
virtual void requestQuit ()
 
virtual bool hasQuitRequest () const
 
virtual void askLoadRecent ()
 
virtual State getState () const
 
virtual void newGame (bool bypass=false)
 
virtual void endGame ()
 
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 deleted too. More...
 
virtual void saveGame (const std::string &description, const Slot *slot=0)
 
virtual void quickSave (std::string name="Quicksave")
 Saves a file, using supplied filename, overwritting if needed. More...
 
virtual void quickLoad ()
 Loads the last saved file. More...
 
virtual void loadGame (const std::string &filepath)
 
virtual void loadGame (const Character *character, const std::string &filepath)
 Load a saved game file belonging to the given character. More...
 
virtual CharactergetCurrentCharacter ()
 
virtual CharacterIterator characterBegin ()
 
virtual CharacterIterator characterEnd ()
 
virtual void update (float duration)
 
- Public Member Functions inherited from MWBase::StateManager
 StateManager ()
 
virtual ~StateManager ()
 

Private Member Functions

void cleanup (bool force=false)
 
bool verifyProfile (const ESM::SavedGame &profile) const
 
void writeScreenshot (std::vector< char > &imageData) const
 
std::map< int, intbuildContentFileIndexMap (const ESM::ESMReader &reader) const
 

Private Attributes

bool mQuitRequest
 
bool mAskLoadRecent
 
State mState
 
CharacterManager mCharacterManager
 
double mTimePlayed
 

Additional Inherited Members

- Public Types inherited from MWBase::StateManager
enum  State { State_NoGame, State_Ended, State_Running }
 
typedef std::list
< MWState::Character >
::const_iterator 
CharacterIterator
 

Constructor & Destructor Documentation

MWState::StateManager::StateManager ( const boost::filesystem::path &  saves,
const std::string &  game 
)

Member Function Documentation

void MWState::StateManager::askLoadRecent ( )
virtual

Implements MWBase::StateManager.

Here is the call graph for this function:

std::map< int, int > MWState::StateManager::buildContentFileIndexMap ( const ESM::ESMReader reader) const
private

Here is the call graph for this function:

MWState::StateManager::CharacterIterator MWState::StateManager::characterBegin ( )
virtual

Any call to SaveGame and getCurrentCharacter can invalidate the returned iterator.

Implements MWBase::StateManager.

MWState::StateManager::CharacterIterator MWState::StateManager::characterEnd ( )
virtual

Implements MWBase::StateManager.

void MWState::StateManager::cleanup ( bool  force = false)
private

Here is the call graph for this function:

void MWState::StateManager::deleteGame ( const MWState::Character character,
const MWState::Slot slot 
)
virtual

Delete a saved game slot from this character. If all save slots are deleted, the character will be deleted too.

Implements MWBase::StateManager.

void MWState::StateManager::endGame ( )
virtual

Implements MWBase::StateManager.

MWState::Character * MWState::StateManager::getCurrentCharacter ( )
virtual
Note
May return null.

Implements MWBase::StateManager.

MWState::StateManager::State MWState::StateManager::getState ( ) const
virtual

Implements MWBase::StateManager.

bool MWState::StateManager::hasQuitRequest ( ) const
virtual

Implements MWBase::StateManager.

void MWState::StateManager::loadGame ( const std::string &  filepath)
virtual

Load a saved game directly from the given file path. This will search the CharacterManager for a Character containing this save file, and set this Character current if one was found. Otherwise, a new Character will be created.

Implements MWBase::StateManager.

Here is the call graph for this function:

void MWState::StateManager::loadGame ( const Character character,
const std::string &  filepath 
)
virtual

Load a saved game file belonging to the given character.

Implements MWBase::StateManager.

void MWState::StateManager::newGame ( bool  bypass = false)
virtual

Start a new game.

Parameters
bypassSkip new game mechanics.

Implements MWBase::StateManager.

Here is the call graph for this function:

void MWState::StateManager::quickLoad ( )
virtual

Loads the last saved file.

Used for quickload

Implements MWBase::StateManager.

void MWState::StateManager::quickSave ( std::string  name = "Quicksave")
virtual

Saves a file, using supplied filename, overwritting if needed.

This is mostly used for quicksaving and autosaving, for they use the same name over and over again

Parameters
nameName of save, defaults to "Quicksave"

Implements MWBase::StateManager.

Here is the call graph for this function:

void MWState::StateManager::requestQuit ( )
virtual

Implements MWBase::StateManager.

void MWState::StateManager::saveGame ( const std::string &  description,
const Slot slot = 0 
)
virtual

Write a saved game to slot or create a new slot if slot == 0.

Note
Slot must belong to the current character.

Implements MWBase::StateManager.

void MWState::StateManager::update ( float  duration)
virtual

Implements MWBase::StateManager.

Here is the call graph for this function:

bool MWState::StateManager::verifyProfile ( const ESM::SavedGame profile) const
private

Here is the call graph for this function:

void MWState::StateManager::writeScreenshot ( std::vector< char > &  imageData) const
private

Here is the call graph for this function:

Member Data Documentation

bool MWState::StateManager::mAskLoadRecent
private
CharacterManager MWState::StateManager::mCharacterManager
private
bool MWState::StateManager::mQuitRequest
private
State MWState::StateManager::mState
private
double MWState::StateManager::mTimePlayed
private

The documentation for this class was generated from the following files: