2013-11-16 10:31:46 +01:00
|
|
|
#ifndef GAME_MWSTATE_STATEMANAGER_H
|
|
|
|
#define GAME_MWSTATE_STATEMANAGER_H
|
|
|
|
|
2013-11-21 11:10:18 +01:00
|
|
|
#include <vector>
|
2013-11-24 15:19:56 +01:00
|
|
|
#include <string>
|
2013-11-21 11:10:18 +01:00
|
|
|
|
2013-11-19 15:38:26 +01:00
|
|
|
namespace MWState
|
|
|
|
{
|
|
|
|
struct Slot;
|
|
|
|
class Character;
|
|
|
|
}
|
|
|
|
|
2013-11-16 10:31:46 +01:00
|
|
|
namespace MWBase
|
|
|
|
{
|
|
|
|
/// \brief Interface for game state manager (implemented in MWState)
|
|
|
|
class StateManager
|
|
|
|
{
|
2013-11-18 15:15:47 +01:00
|
|
|
public:
|
|
|
|
|
|
|
|
enum State
|
|
|
|
{
|
|
|
|
State_NoGame,
|
|
|
|
State_Ended,
|
|
|
|
State_Running
|
|
|
|
};
|
|
|
|
|
2013-11-21 11:10:18 +01:00
|
|
|
typedef std::vector<MWState::Character>::const_iterator CharacterIterator;
|
|
|
|
|
2013-11-16 10:31:46 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
StateManager (const StateManager&);
|
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
StateManager& operator= (const StateManager&);
|
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
StateManager() {}
|
|
|
|
|
|
|
|
virtual ~StateManager() {}
|
2013-11-16 11:07:23 +01:00
|
|
|
|
|
|
|
virtual void requestQuit() = 0;
|
|
|
|
|
|
|
|
virtual bool hasQuitRequest() const = 0;
|
2013-11-16 12:22:28 +01:00
|
|
|
|
2013-12-19 22:08:34 +02:00
|
|
|
virtual void askLoadRecent() = 0;
|
|
|
|
|
2013-11-18 15:15:47 +01:00
|
|
|
virtual State getState() const = 0;
|
2013-11-16 12:22:28 +01:00
|
|
|
|
|
|
|
virtual void newGame (bool bypass = false) = 0;
|
|
|
|
///< Start a new game.
|
|
|
|
///
|
|
|
|
/// \param bypass Skip new game mechanics.
|
2013-11-18 15:38:08 +01:00
|
|
|
|
|
|
|
virtual void endGame() = 0;
|
2013-11-19 15:38:26 +01:00
|
|
|
|
2013-11-24 15:19:56 +01:00
|
|
|
virtual void saveGame (const std::string& description, const MWState::Slot *slot = 0) = 0;
|
2013-11-19 15:38:26 +01:00
|
|
|
///< 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 12:24:24 +01:00
|
|
|
virtual void loadGame (const MWState::Character *character, const MWState::Slot *slot) = 0;
|
|
|
|
///< Load a saved game file from \a slot.
|
|
|
|
///
|
|
|
|
/// \note \a slot must belong to \a character.
|
|
|
|
|
2013-11-24 16:58:41 +01:00
|
|
|
virtual MWState::Character *getCurrentCharacter (bool create = true) = 0;
|
|
|
|
///< \param create Create a new character, if there is no current character.
|
2013-11-21 11:10:18 +01:00
|
|
|
|
|
|
|
virtual CharacterIterator characterBegin() = 0;
|
2013-11-21 12:29:24 +01:00
|
|
|
///< Any call to SaveGame and getCurrentCharacter can invalidate the returned
|
|
|
|
/// iterator.
|
2013-11-21 11:10:18 +01:00
|
|
|
|
|
|
|
virtual CharacterIterator characterEnd() = 0;
|
2013-11-28 09:33:50 +01:00
|
|
|
|
|
|
|
virtual void update (float duration) = 0;
|
2013-11-16 10:31:46 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|