2012-08-11 12:02:51 +02:00
|
|
|
#ifndef GAME_MWDIALOG_JOURNAL_H
|
2011-04-04 11:16:56 +02:00
|
|
|
#define GAME_MWDIALOG_JOURNAL_H
|
|
|
|
|
2012-08-09 12:56:03 +02:00
|
|
|
#include "../mwbase/journal.hpp"
|
2011-04-19 11:02:22 +02:00
|
|
|
|
|
|
|
#include "journalentry.hpp"
|
2011-04-26 20:08:37 +02:00
|
|
|
#include "quest.hpp"
|
2011-04-04 11:23:15 +02:00
|
|
|
|
2011-04-04 11:16:56 +02:00
|
|
|
namespace MWDialogue
|
|
|
|
{
|
2011-04-26 20:08:37 +02:00
|
|
|
/// \brief The player's journal
|
2012-08-09 12:56:03 +02:00
|
|
|
class Journal : public MWBase::Journal
|
2011-04-04 11:16:56 +02:00
|
|
|
{
|
2011-04-22 11:16:39 +02:00
|
|
|
TEntryContainer mJournal;
|
2011-04-26 20:08:37 +02:00
|
|
|
TQuestContainer mQuests;
|
2011-04-26 20:48:36 +02:00
|
|
|
TTopicContainer mTopics;
|
2011-04-26 20:08:37 +02:00
|
|
|
|
2013-12-03 14:28:46 +01:00
|
|
|
private:
|
|
|
|
|
2011-04-26 20:08:37 +02:00
|
|
|
Quest& getQuest (const std::string& id);
|
2011-04-04 11:16:56 +02:00
|
|
|
|
2013-12-03 14:28:46 +01:00
|
|
|
Topic& getTopic (const std::string& id);
|
|
|
|
|
2013-12-03 14:39:54 +01:00
|
|
|
bool isThere (const std::string& topicId, const std::string& infoId = "") const;
|
|
|
|
|
2011-04-04 11:16:56 +02:00
|
|
|
public:
|
|
|
|
|
2012-04-23 15:27:03 +02:00
|
|
|
Journal();
|
2011-04-04 11:23:15 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void clear() override;
|
2013-05-15 17:54:18 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void addEntry (const std::string& id, int index, const MWWorld::Ptr& actor) override;
|
2011-04-04 11:23:15 +02:00
|
|
|
///< Add a journal entry.
|
2016-01-11 23:07:01 +01:00
|
|
|
/// @param actor Used as context for replacing of escape sequences (%name, etc).
|
2011-04-04 11:23:15 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void setJournalIndex (const std::string& id, int index) override;
|
2011-04-04 11:23:15 +02:00
|
|
|
///< Set the journal index without adding an entry.
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
int getJournalIndex (const std::string& id) const override;
|
2011-04-04 11:23:15 +02:00
|
|
|
///< Get the journal index.
|
2011-04-19 11:02:22 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void addTopic (const std::string& topicId, const std::string& infoId, const MWWorld::Ptr& actor) override;
|
2014-06-10 16:36:22 +02:00
|
|
|
/// \note topicId must be lowercase
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void removeLastAddedTopicResponse (const std::string& topicId, const std::string& actorName) override;
|
2014-06-10 16:36:22 +02:00
|
|
|
///< Removes the last topic response added for the given topicId and actor name.
|
|
|
|
/// \note topicId must be lowercase
|
2011-04-26 20:48:36 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
TEntryIter begin() const override;
|
2011-04-19 11:02:22 +02:00
|
|
|
///< Iterator pointing to the begin of the main journal.
|
|
|
|
///
|
|
|
|
/// \note Iterators to main journal entries will never become invalid.
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
TEntryIter end() const override;
|
2011-04-19 11:02:22 +02:00
|
|
|
///< Iterator pointing past the end of the main journal.
|
2011-04-26 20:08:37 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
TQuestIter questBegin() const override;
|
2011-04-26 20:08:37 +02:00
|
|
|
///< Iterator pointing to the first quest (sorted by topic ID)
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
TQuestIter questEnd() const override;
|
2011-04-26 20:08:37 +02:00
|
|
|
///< Iterator pointing past the last quest.
|
2011-04-26 20:48:36 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
TTopicIter topicBegin() const override;
|
2011-04-26 20:48:36 +02:00
|
|
|
///< Iterator pointing to the first topic (sorted by topic ID)
|
|
|
|
///
|
|
|
|
/// \note The topic ID is identical with the user-visible topic string.
|
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
TTopicIter topicEnd() const override;
|
2011-04-26 20:48:36 +02:00
|
|
|
///< Iterator pointing past the last topic.
|
2013-12-03 14:28:46 +01:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
int countSavedGameRecords() const override;
|
2013-12-03 14:28:46 +01:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void write (ESM::ESMWriter& writer, Loading::Listener& progress) const override;
|
2013-12-03 14:28:46 +01:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void readRecord (ESM::ESMReader& reader, uint32_t type) override;
|
2011-04-04 11:16:56 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|