1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 16:49:55 +00:00
openmw-tes3mp/apps/openmw/mwdialogue/journalimp.hpp

98 lines
3.3 KiB
C++
Raw Normal View History

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
#include "../mwbase/journal.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
class Journal : public MWBase::Journal
2011-04-04 09:16:56 +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);
bool isThere (const std::string& topicId, const std::string& infoId = "") const;
2011-04-04 09:16:56 +00:00
public:
Journal();
2011-04-04 09:23:15 +00:00
void clear() override;
2013-05-15 15:54:18 +00:00
/*
Start of tes3mp addition
Make it possible to check whether a journal entry already exists from elsewhere in the code
*/
virtual bool hasEntry(const std::string& id, int index);
/*
End of tes3mp addition
*/
/*
Start of tes3mp change (minor)
Make it possible to override current time when adding journal entries, by adding
optional timestamp override arguments
*/
void addEntry (const std::string& id, int index, const MWWorld::Ptr& actor, int daysPassed = -1, int month = -1, int day = -1) override;
2011-04-04 09:23:15 +00:00
///< Add a journal entry.
/// @param actor Used as context for replacing of escape sequences (%name, etc).
/*
End of tes3mp change (major)
*/
2011-04-04 09:23:15 +00:00
void setJournalIndex (const std::string& id, int index) override;
2011-04-04 09:23:15 +00:00
///< Set the journal index without adding an entry.
int getJournalIndex (const std::string& id) const override;
2011-04-04 09:23:15 +00:00
///< Get the journal index.
void addTopic (const std::string& topicId, const std::string& infoId, const MWWorld::Ptr& actor) override;
/// \note topicId must be lowercase
void removeLastAddedTopicResponse (const std::string& topicId, const std::string& actorName) override;
///< Removes the last topic response added for the given topicId and actor name.
/// \note topicId must be lowercase
2011-04-26 18:48:36 +00:00
TEntryIter begin() const override;
///< Iterator pointing to the begin of the main journal.
///
/// \note Iterators to main journal entries will never become invalid.
TEntryIter end() const override;
///< Iterator pointing past the end of the main journal.
2011-04-26 18:08:37 +00:00
TQuestIter questBegin() const override;
2011-04-26 18:08:37 +00:00
///< Iterator pointing to the first quest (sorted by topic ID)
TQuestIter questEnd() const override;
2011-04-26 18:08:37 +00:00
///< Iterator pointing past the last quest.
2011-04-26 18:48:36 +00:00
TTopicIter topicBegin() const override;
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.
TTopicIter topicEnd() const override;
2011-04-26 18:48:36 +00:00
///< Iterator pointing past the last topic.
2013-12-03 13:28:46 +00:00
int countSavedGameRecords() const override;
2013-12-03 13:28:46 +00:00
void write (ESM::ESMWriter& writer, Loading::Listener& progress) const override;
2013-12-03 13:28:46 +00:00
void readRecord (ESM::ESMReader& reader, uint32_t type) override;
2011-04-04 09:16:56 +00:00
};
}
#endif