Issue #107: Journal is accessed only through the interface class from now on
parent
a84145a087
commit
d00d40cc3f
@ -0,0 +1,76 @@
|
||||
#ifndef GAME_MWBASE_JOURNAL_H
|
||||
#define GAME_MWBASE_JOURNAL_H
|
||||
|
||||
#include <string>
|
||||
#include <deque>
|
||||
#include <map>
|
||||
|
||||
namespace MWDialogue
|
||||
{
|
||||
class Quest;
|
||||
class Topic;
|
||||
struct StampedJournalEntry;
|
||||
}
|
||||
|
||||
namespace MWBase
|
||||
{
|
||||
/// \brief Interface for the player's journal (implemented in MWDialogue)
|
||||
class Journal
|
||||
{
|
||||
Journal (const Journal&);
|
||||
///< not implemented
|
||||
|
||||
Journal& operator= (const Journal&);
|
||||
///< not implemented
|
||||
|
||||
public:
|
||||
|
||||
typedef std::deque<MWDialogue::StampedJournalEntry> TEntryContainer;
|
||||
typedef TEntryContainer::const_iterator TEntryIter;
|
||||
typedef std::map<std::string, MWDialogue::Quest> TQuestContainer; // topc, quest
|
||||
typedef TQuestContainer::const_iterator TQuestIter;
|
||||
typedef std::map<std::string, MWDialogue::Topic> TTopicContainer; // topic-id, topic-content
|
||||
typedef TTopicContainer::const_iterator TTopicIter;
|
||||
|
||||
public:
|
||||
|
||||
Journal() {}
|
||||
|
||||
virtual ~Journal() {}
|
||||
|
||||
virtual void addEntry (const std::string& id, int index) = 0;
|
||||
///< Add a journal entry.
|
||||
|
||||
virtual void setJournalIndex (const std::string& id, int index) = 0;
|
||||
///< Set the journal index without adding an entry.
|
||||
|
||||
virtual int getJournalIndex (const std::string& id) const = 0;
|
||||
///< Get the journal index.
|
||||
|
||||
virtual void addTopic (const std::string& topicId, const std::string& infoId) = 0;
|
||||
|
||||
virtual TEntryIter begin() const = 0;
|
||||
///< Iterator pointing to the begin of the main journal.
|
||||
///
|
||||
/// \note Iterators to main journal entries will never become invalid.
|
||||
|
||||
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)
|
||||
|
||||
virtual TQuestIter questEnd() const = 0;
|
||||
///< Iterator pointing past the last quest.
|
||||
|
||||
virtual TTopicIter topicBegin() const = 0;
|
||||
///< 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 = 0;
|
||||
///< Iterator pointing past the last topic.
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
|
||||
#include "journal.hpp"
|
||||
#include "journalimp.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
Loading…
Reference in New Issue