openmw-tes3coop/apps/openmw/mwdialogue/quest.hpp

63 lines
1.5 KiB
C++
Raw Normal View History

2011-04-26 18:08:37 +00:00
#ifndef GAME_MMDIALOG_QUEST_H
#define GAME_MWDIALOG_QUEST_H
#include <string>
#include <vector>
#include "journalentry.hpp"
namespace MWWorld
{
class World;
}
namespace MWDialogue
{
/// \brief A quest in progress or a compelted quest
class Quest
{
public:
typedef std::vector<std::string> TEntryContainer;
2011-04-26 18:08:37 +00:00
typedef TEntryContainer::const_iterator TEntryIter;
private:
std::string mTopic;
int mIndex;
TEntryContainer mEntries; // info-IDs
2011-04-26 18:08:37 +00:00
bool mFinished;
public:
Quest();
Quest (const std::string& topic);
const std::string getName (const MWWorld::World& world) const;
///< May be an empty string
int getIndex() const;
void setIndex (int index, const MWWorld::World& world);
///< Calling this function with a non-existant index while throw an exception.
bool isFinished() const;
void addEntry (const JournalEntry& entry, const MWWorld::World& world);
///< Add entry and adjust index accordingly.
///
/// \note Redundant entries are ignored, but the index is still adjusted.
TEntryIter begin();
///< Iterator pointing to the begin of the journal for this quest.
TEntryIter end();
///< Iterator pointing past the end of the journal for this quest.
JournalEntry getEntry (const std::string& infoId);
2011-04-26 18:08:37 +00:00
};
}
#endif