1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-08 09:37:53 +00:00
OpenMW/apps/openmw/mwdialogue/journalimp.hpp
scrawl 27a05027f4 Fixes #1172: Added basic loading/saving progress bar
The progress is not particularly accurate. It simply uses the current / total number of records written/read as indication. Cell records are currently the largest by far, but there is a good chance that could be optimized using a change tracking system.
2014-04-28 11:29:57 +02:00

74 lines
2.2 KiB
C++

#ifndef GAME_MWDIALOG_JOURNAL_H
#define GAME_MWDIALOG_JOURNAL_H
#include "../mwbase/journal.hpp"
#include "journalentry.hpp"
#include "quest.hpp"
namespace MWDialogue
{
/// \brief The player's journal
class Journal : public MWBase::Journal
{
TEntryContainer mJournal;
TQuestContainer mQuests;
TTopicContainer mTopics;
private:
Quest& getQuest (const std::string& id);
Topic& getTopic (const std::string& id);
bool isThere (const std::string& topicId, const std::string& infoId = "") const;
public:
Journal();
virtual void clear();
virtual void addEntry (const std::string& id, int index);
///< Add a journal entry.
virtual void setJournalIndex (const std::string& id, int index);
///< Set the journal index without adding an entry.
virtual int getJournalIndex (const std::string& id) const;
///< Get the journal index.
virtual void addTopic (const std::string& topicId, const std::string& infoId, const std::string& actorName);
virtual TEntryIter begin() const;
///< Iterator pointing to the begin of the main journal.
///
/// \note Iterators to main journal entries will never become invalid.
virtual TEntryIter end() const;
///< Iterator pointing past the end of the main journal.
virtual TQuestIter questBegin() const;
///< Iterator pointing to the first quest (sorted by topic ID)
virtual TQuestIter questEnd() const;
///< Iterator pointing past the last quest.
virtual TTopicIter topicBegin() const;
///< Iterator pointing to the first topic (sorted by topic ID)
///
/// \note The topic ID is identical with the user-visible topic string.
virtual TTopicIter topicEnd() const;
///< Iterator pointing past the last topic.
virtual int countSavedGameRecords() const;
virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const;
virtual void readRecord (ESM::ESMReader& reader, int32_t type);
};
}
#endif