removed redundant data from quest class

This commit is contained in:
Marc Zinnschlag 2011-04-26 20:22:50 +02:00
parent 944291d34f
commit 3406d2fa89
2 changed files with 11 additions and 4 deletions

View file

@ -78,10 +78,10 @@ namespace MWDialogue
setIndex (index, world); setIndex (index, world);
for (TEntryIter iter (mEntries.begin()); iter!=mEntries.end(); ++iter) for (TEntryIter iter (mEntries.begin()); iter!=mEntries.end(); ++iter)
if (iter->mInfoId==entry.mInfoId) if (*iter==entry.mInfoId)
return; return;
mEntries.push_back (entry); mEntries.push_back (entry.mInfoId);
} }
Quest::TEntryIter Quest::begin() Quest::TEntryIter Quest::begin()
@ -93,4 +93,9 @@ namespace MWDialogue
{ {
return mEntries.end(); return mEntries.end();
} }
JournalEntry Quest::getEntry (const std::string& infoId)
{
return JournalEntry (mTopic, infoId);
}
} }

View file

@ -18,14 +18,14 @@ namespace MWDialogue
{ {
public: public:
typedef std::vector<JournalEntry> TEntryContainer; typedef std::vector<std::string> TEntryContainer;
typedef TEntryContainer::const_iterator TEntryIter; typedef TEntryContainer::const_iterator TEntryIter;
private: private:
std::string mTopic; std::string mTopic;
int mIndex; int mIndex;
std::vector<JournalEntry> mEntries; TEntryContainer mEntries; // info-IDs
bool mFinished; bool mFinished;
public: public:
@ -54,6 +54,8 @@ namespace MWDialogue
TEntryIter end(); TEntryIter end();
///< Iterator pointing past the end of the journal for this quest. ///< Iterator pointing past the end of the journal for this quest.
JournalEntry getEntry (const std::string& infoId);
}; };
} }