1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-28 03:40:04 +00:00

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
{
2022-09-22 21:26:05 +03:00
int mIndex;
bool mFinished;
2011-04-26 20:08:37 +02:00
2022-09-22 21:26:05 +03:00
public:
Quest();
2011-04-26 20:08:37 +02:00
2022-09-22 21:26:05 +03:00
Quest(const std::string& topic);
2011-04-26 20:08:37 +02:00
2022-09-22 21:26:05 +03:00
Quest(const ESM::QuestState& state);
2011-04-26 20:08:37 +02:00
2022-09-22 21:26:05 +03:00
std::string_view getName() const override;
///< May be an empty string
2013-12-03 14:28:46 +01:00
2022-09-22 21:26:05 +03:00
int getIndex() const;
2011-04-26 20:08:37 +02:00
2022-09-22 21:26:05 +03:00
void setIndex(int index);
///< Calling this function with a non-existent index will throw an exception.
2011-04-26 20:08:37 +02:00
2022-09-22 21:26:05 +03:00
bool isFinished() const;
void setFinished(bool finished);
2011-04-26 20:08:37 +02:00
2022-09-22 21:26:05 +03:00
bool addEntry(const JournalEntry& entry) override;
///< Add entry and adjust index accordingly. Returns true if the quest should be restarted.
///
/// \note Redundant entries are ignored, but the index is still adjusted.
2011-04-26 20:08:37 +02:00
2022-09-22 21:26:05 +03:00
void write(ESM::QuestState& state) const;
2011-04-26 20:08:37 +02:00
};
}
#endif