2012-08-11 10:02:51 +00:00
|
|
|
#ifndef GAME_MWDIALOG_JOURNAL_H
|
2011-04-04 09:16:56 +00:00
|
|
|
#define GAME_MWDIALOG_JOURNAL_H
|
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
#include "../mwbase/journal.hpp"
|
2011-04-19 09:02:22 +00:00
|
|
|
|
|
|
|
#include "journalentry.hpp"
|
2011-04-26 18:08:37 +00:00
|
|
|
#include "quest.hpp"
|
2011-04-04 09:23:15 +00:00
|
|
|
|
2011-04-04 09:16:56 +00:00
|
|
|
namespace MWDialogue
|
|
|
|
{
|
2011-04-26 18:08:37 +00:00
|
|
|
/// \brief The player's journal
|
2012-08-09 10:56:03 +00:00
|
|
|
class Journal : public MWBase::Journal
|
2011-04-04 09:16:56 +00:00
|
|
|
{
|
2011-04-22 09:16:39 +00:00
|
|
|
TEntryContainer mJournal;
|
2011-04-26 18:08:37 +00:00
|
|
|
TQuestContainer mQuests;
|
2011-04-26 18:48:36 +00:00
|
|
|
TTopicContainer mTopics;
|
2011-04-26 18:08:37 +00:00
|
|
|
|
2013-12-03 13:28:46 +00:00
|
|
|
private:
|
|
|
|
|
2011-04-26 18:08:37 +00:00
|
|
|
Quest& getQuest (const std::string& id);
|
2011-04-04 09:16:56 +00:00
|
|
|
|
2013-12-03 13:28:46 +00:00
|
|
|
Topic& getTopic (const std::string& id);
|
|
|
|
|
2013-12-03 13:39:54 +00:00
|
|
|
bool isThere (const std::string& topicId, const std::string& infoId = "") const;
|
|
|
|
|
2011-04-04 09:16:56 +00:00
|
|
|
public:
|
|
|
|
|
2012-04-23 13:27:03 +00:00
|
|
|
Journal();
|
2011-04-04 09:23:15 +00:00
|
|
|
|
2013-05-15 15:54:18 +00:00
|
|
|
virtual void clear();
|
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual void addEntry (const std::string& id, int index);
|
2011-04-04 09:23:15 +00:00
|
|
|
///< Add a journal entry.
|
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual void setJournalIndex (const std::string& id, int index);
|
2011-04-04 09:23:15 +00:00
|
|
|
///< Set the journal index without adding an entry.
|
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual int getJournalIndex (const std::string& id) const;
|
2011-04-04 09:23:15 +00:00
|
|
|
///< Get the journal index.
|
2011-04-19 09:02:22 +00:00
|
|
|
|
2014-01-25 22:53:50 +00:00
|
|
|
virtual void addTopic (const std::string& topicId, const std::string& infoId, const std::string& actorName);
|
2011-04-26 18:48:36 +00:00
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual TEntryIter begin() const;
|
2011-04-19 09:02:22 +00:00
|
|
|
///< Iterator pointing to the begin of the main journal.
|
|
|
|
///
|
|
|
|
/// \note Iterators to main journal entries will never become invalid.
|
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual TEntryIter end() const;
|
2011-04-19 09:02:22 +00:00
|
|
|
///< Iterator pointing past the end of the main journal.
|
2011-04-26 18:08:37 +00:00
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual TQuestIter questBegin() const;
|
2011-04-26 18:08:37 +00:00
|
|
|
///< Iterator pointing to the first quest (sorted by topic ID)
|
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual TQuestIter questEnd() const;
|
2011-04-26 18:08:37 +00:00
|
|
|
///< Iterator pointing past the last quest.
|
2011-04-26 18:48:36 +00:00
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual TTopicIter topicBegin() const;
|
2011-04-26 18:48:36 +00:00
|
|
|
///< Iterator pointing to the first topic (sorted by topic ID)
|
|
|
|
///
|
|
|
|
/// \note The topic ID is identical with the user-visible topic string.
|
|
|
|
|
2012-08-09 10:56:03 +00:00
|
|
|
virtual TTopicIter topicEnd() const;
|
2011-04-26 18:48:36 +00:00
|
|
|
///< Iterator pointing past the last topic.
|
2013-12-03 13:28:46 +00:00
|
|
|
|
|
|
|
virtual int countSavedGameRecords() const;
|
|
|
|
|
2014-04-28 09:29:57 +00:00
|
|
|
virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;
|
2013-12-03 13:28:46 +00:00
|
|
|
|
|
|
|
virtual void readRecord (ESM::ESMReader& reader, int32_t type);
|
2011-04-04 09:16:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|