mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-11-04 01:26:41 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			44 lines
		
	
	
	
		
			854 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
	
		
			854 B
		
	
	
	
		
			C++
		
	
	
	
	
	
 | 
						|
#include "topic.hpp"
 | 
						|
 | 
						|
#include "../mwworld/esmstore.hpp"
 | 
						|
 | 
						|
namespace MWDialogue
 | 
						|
{
 | 
						|
    Topic::Topic()
 | 
						|
    {}
 | 
						|
 | 
						|
    Topic::Topic (const std::string& topic)
 | 
						|
    : mTopic (topic)
 | 
						|
    {}
 | 
						|
 | 
						|
    Topic::~Topic()
 | 
						|
    {}
 | 
						|
 | 
						|
    void Topic::addEntry (const JournalEntry& entry)
 | 
						|
    {
 | 
						|
        if (entry.mTopic!=mTopic)
 | 
						|
            throw std::runtime_error ("topic does not match: " + mTopic);
 | 
						|
 | 
						|
        for (TEntryIter iter = begin(); iter!=end(); ++iter)
 | 
						|
            if (*iter==entry.mInfoId)
 | 
						|
                return;
 | 
						|
 | 
						|
        mEntries.push_back (entry.mInfoId);
 | 
						|
    }
 | 
						|
 | 
						|
    Topic::TEntryIter Topic::begin() const
 | 
						|
    {
 | 
						|
        return mEntries.begin();
 | 
						|
    }
 | 
						|
 | 
						|
    Topic::TEntryIter Topic::end() const
 | 
						|
    {
 | 
						|
        return mEntries.end();
 | 
						|
    }
 | 
						|
 | 
						|
    JournalEntry Topic::getEntry (const std::string& infoId) const
 | 
						|
    {
 | 
						|
        return JournalEntry (mTopic, infoId);
 | 
						|
    }
 | 
						|
}
 |