2012-08-11 12:02:51 +02:00
|
|
|
#ifndef GAME_MWDIALOG_TOPIC_H
|
2011-04-26 20:39:59 +02:00
|
|
|
#define GAME_MWDIALOG_TOPIC_H
|
|
|
|
|
|
|
|
#include <string>
|
2022-08-16 21:15:03 +02:00
|
|
|
#include <string_view>
|
2011-04-26 20:39:59 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "journalentry.hpp"
|
|
|
|
|
2013-12-03 14:28:46 +01:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
struct JournalEntry;
|
|
|
|
}
|
|
|
|
|
2011-04-26 20:39:59 +02:00
|
|
|
namespace MWDialogue
|
|
|
|
{
|
|
|
|
/// \brief Collection of seen responses for a topic
|
|
|
|
class Topic
|
|
|
|
{
|
|
|
|
public:
|
2013-12-01 14:50:25 +01:00
|
|
|
typedef std::vector<Entry> TEntryContainer;
|
2011-04-26 20:39:59 +02:00
|
|
|
typedef TEntryContainer::const_iterator TEntryIter;
|
|
|
|
|
2013-12-01 14:50:25 +01:00
|
|
|
protected:
|
|
|
|
std::string mTopic;
|
2011-04-26 20:39:59 +02:00
|
|
|
std::string mName;
|
|
|
|
TEntryContainer mEntries;
|
|
|
|
|
|
|
|
public:
|
2022-09-22 21:26:05 +03:00
|
|
|
Topic();
|
2011-04-26 20:39:59 +02:00
|
|
|
|
|
|
|
Topic(const std::string& topic);
|
|
|
|
|
|
|
|
virtual ~Topic();
|
|
|
|
|
|
|
|
virtual bool addEntry(const JournalEntry& entry);
|
|
|
|
///< Add entry
|
2022-09-22 21:26:05 +03:00
|
|
|
///
|
2011-04-26 20:39:59 +02:00
|
|
|
/// \note Redundant entries are ignored.
|
|
|
|
|
|
|
|
void insertEntry(const ESM::JournalEntry& entry);
|
|
|
|
///< Add entry without checking for redundant entries or modifying the state of the
|
|
|
|
/// topic otherwise
|
|
|
|
|
|
|
|
std::string getTopic() const;
|
|
|
|
|
2022-02-12 13:25:27 +01:00
|
|
|
virtual std::string_view getName() const;
|
2011-04-26 20:39:59 +02:00
|
|
|
|
2013-12-03 14:28:46 +01:00
|
|
|
void removeLastAddedResponse(std::string_view actorName);
|
|
|
|
|
|
|
|
TEntryIter begin() const;
|
|
|
|
///< Iterator pointing to the begin of the journal for this topic.
|
|
|
|
|
2013-01-19 16:21:41 -08:00
|
|
|
TEntryIter end() const;
|
2011-04-26 20:39:59 +02:00
|
|
|
///< Iterator pointing past the end of the journal for this topic.
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|