1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00
OpenMW/apps/openmw/mwdialogue/journal.hpp

66 lines
1.7 KiB
C++
Raw Normal View History

2011-04-04 09:16:56 +00:00
#ifndef GAME_MMDIALOG_JOURNAL_H
#define GAME_MWDIALOG_JOURNAL_H
2011-04-04 09:23:15 +00:00
#include <string>
#include <deque>
2011-04-26 18:08:37 +00:00
#include <map>
#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 MWWorld
{
struct Environment;
}
namespace MWDialogue
{
2011-04-26 18:08:37 +00:00
/// \brief The player's journal
2011-04-04 09:16:56 +00:00
class Journal
{
public:
typedef std::deque<StampedJournalEntry> TEntryContainer;
typedef TEntryContainer::const_iterator TEntryIter;
2011-04-26 18:08:37 +00:00
typedef std::map<std::string, Quest> TQuestContainer; // topc, quest
typedef TQuestContainer::const_iterator TQuestIter;
private:
2011-04-04 09:16:56 +00:00
MWWorld::Environment& mEnvironment;
TEntryContainer mJournal;
2011-04-26 18:08:37 +00:00
TQuestContainer mQuests;
Quest& getQuest (const std::string& id);
2011-04-04 09:16:56 +00:00
public:
Journal (MWWorld::Environment& environment);
2011-04-04 09:23:15 +00:00
void addEntry (const std::string& id, int index);
///< Add a journal entry.
void setJournalIndex (const std::string& id, int index);
///< Set the journal index without adding an entry.
int getJournalIndex (const std::string& id) const;
///< Get the journal index.
TEntryIter begin() const;
///< Iterator pointing to the begin of the main journal.
///
/// \note Iterators to main journal entries will never become invalid.
TEntryIter end() const;
///< Iterator pointing past the end of the main journal.
2011-04-26 18:08:37 +00:00
TQuestIter questBegin() const;
///< Iterator pointing to the first quest (sorted by topic ID)
TQuestIter questEnd() const;
///< Iterator pointing past the last quest.
2011-04-04 09:16:56 +00:00
};
}
#endif