1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-27 18:41:05 +00:00

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.0 KiB
C++
Raw Normal View History

2012-08-11 12:02:51 +02:00
#ifndef GAME_MWDIALOG_QUEST_H
2011-04-26 20:08:37 +02:00
#define GAME_MWDIALOG_QUEST_H
#include "topic.hpp"
2011-04-26 20:08:37 +02:00
2013-12-03 14:28:46 +01:00
namespace ESM
{
struct QuestState;
}
2011-04-26 20:08:37 +02:00
namespace MWDialogue
{
2013-11-30 12:02:56 +01:00
/// \brief A quest in progress or a completed quest
class Quest : public Topic
2011-04-26 20:08:37 +02:00
{
int mIndex;
bool mFinished;
public:
2022-09-22 21:26:05 +03:00
Quest();
2011-04-26 20:08:37 +02:00
Quest(const std::string& topic);
Quest(const ESM::QuestState& state);
2013-12-03 14:28:46 +01:00
std::string_view getName() const override;
///< May be an empty string
2022-08-24 20:38:52 +02:00
int getIndex() const;
2011-04-26 20:08:37 +02:00
void setIndex(int index);
///< Calling this function with a non-existent index will throw an exception.
bool isFinished() const;
void setFinished(bool finished);
2011-04-26 20:08:37 +02:00
bool addEntry(const JournalEntry& entry) override;
///< Add entry and adjust index accordingly. Returns true if the quest should be restarted.
2022-09-22 21:26:05 +03:00
///
/// \note Redundant entries are ignored, but the index is still adjusted.
2011-04-26 20:08:37 +02:00
2013-12-03 14:28:46 +01:00
void write(ESM::QuestState& state) const;
2011-04-26 20:08:37 +02:00
};
}
#endif