OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
journal.hpp
Go to the documentation of this file.
1 #ifndef GAME_MWBASE_JOURNAL_H
2 #define GAME_MWBASE_JOURNAL_H
3 
4 #include <string>
5 #include <deque>
6 #include <map>
7 
8 #include <stdint.h>
9 
10 #include "../mwdialogue/journalentry.hpp"
11 #include "../mwdialogue/topic.hpp"
12 #include "../mwdialogue/quest.hpp"
13 
14 namespace Loading
15 {
16  class Listener;
17 }
18 
19 namespace ESM
20 {
21  class ESMReader;
22  class ESMWriter;
23 }
24 
25 namespace MWBase
26 {
28  class Journal
29  {
30  Journal (const Journal&);
32 
33  Journal& operator= (const Journal&);
35 
36  public:
37 
38  typedef std::deque<MWDialogue::StampedJournalEntry> TEntryContainer;
39  typedef TEntryContainer::const_iterator TEntryIter;
40  typedef std::map<std::string, MWDialogue::Quest> TQuestContainer; // topic, quest
41  typedef TQuestContainer::const_iterator TQuestIter;
42  typedef std::map<std::string, MWDialogue::Topic> TTopicContainer; // topic-id, topic-content
43  typedef TTopicContainer::const_iterator TTopicIter;
44 
45  public:
46 
47  Journal() {}
48 
49  virtual void clear() = 0;
50 
51  virtual ~Journal() {}
52 
53  virtual void addEntry (const std::string& id, int index, const MWWorld::Ptr& actor) = 0;
56 
57  virtual void setJournalIndex (const std::string& id, int index) = 0;
59 
60  virtual int getJournalIndex (const std::string& id) const = 0;
62 
63  virtual void addTopic (const std::string& topicId, const std::string& infoId, const MWWorld::Ptr& actor) = 0;
65 
66  virtual void removeLastAddedTopicResponse (const std::string& topicId, const std::string& actorName) = 0;
69 
70  virtual TEntryIter begin() const = 0;
74 
75  virtual TEntryIter end() const = 0;
77 
78  virtual TQuestIter questBegin() const = 0;
80 
81  virtual TQuestIter questEnd() const = 0;
83 
84  virtual TTopicIter topicBegin() const = 0;
88 
89  virtual TTopicIter topicEnd() const = 0;
91 
92  virtual int countSavedGameRecords() const = 0;
93 
94  virtual void write (ESM::ESMWriter& writer, Loading::Listener& progress) const = 0;
95 
96  virtual void readRecord (ESM::ESMReader& reader, uint32_t type) = 0;
97  };
98 }
99 
100 #endif
virtual ~Journal()
Definition: journal.hpp:51
virtual void readRecord(ESM::ESMReader &reader, uint32_t type)=0
std::map< std::string, MWDialogue::Quest > TQuestContainer
Definition: journal.hpp:40
Definition: esmreader.hpp:21
Interface for the player's journal (implemented in MWDialogue)
Definition: journal.hpp:28
virtual TTopicIter topicBegin() const =0
std::deque< MWDialogue::StampedJournalEntry > TEntryContainer
Definition: journal.hpp:38
virtual TTopicIter topicEnd() const =0
Iterator pointing past the last topic.
virtual void addEntry(const std::string &id, int index, const MWWorld::Ptr &actor)=0
virtual int getJournalIndex(const std::string &id) const =0
Get the journal index.
std::map< std::string, MWDialogue::Topic > TTopicContainer
Definition: journal.hpp:42
Definition: loadinglistener.hpp:8
virtual void setJournalIndex(const std::string &id, int index)=0
Set the journal index without adding an entry.
Definition: esmwriter.hpp:17
virtual void removeLastAddedTopicResponse(const std::string &topicId, const std::string &actorName)=0
TQuestContainer::const_iterator TQuestIter
Definition: journal.hpp:41
virtual TEntryIter begin() const =0
virtual TEntryIter end() const =0
Iterator pointing past the end of the main journal.
virtual TQuestIter questBegin() const =0
Iterator pointing to the first quest (sorted by topic ID)
TEntryContainer::const_iterator TEntryIter
Definition: journal.hpp:39
Journal & operator=(const Journal &)
not implemented
virtual void addTopic(const std::string &topicId, const std::string &infoId, const MWWorld::Ptr &actor)=0
virtual void write(ESM::ESMWriter &writer, Loading::Listener &progress) const =0
TTopicContainer::const_iterator TTopicIter
Definition: journal.hpp:43
virtual void clear()=0
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
virtual TQuestIter questEnd() const =0
Iterator pointing past the last quest.
Journal()
Definition: journal.hpp:47
virtual int countSavedGameRecords() const =0