mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 11:56:39 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
	
		
			837 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
	
		
			837 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#include "effectlist.hpp"
 | 
						|
 | 
						|
#include "esmreader.hpp"
 | 
						|
#include "esmwriter.hpp"
 | 
						|
 | 
						|
#include <components/misc/concepts.hpp>
 | 
						|
 | 
						|
namespace ESM
 | 
						|
{
 | 
						|
    template <Misc::SameAsWithoutCvref<ENAMstruct> T>
 | 
						|
    void decompose(T&& v, const auto& f)
 | 
						|
    {
 | 
						|
        f(v.mEffectID, v.mSkill, v.mAttribute, v.mRange, v.mArea, v.mDuration, v.mMagnMin, v.mMagnMax);
 | 
						|
    }
 | 
						|
 | 
						|
    void EffectList::load(ESMReader& esm)
 | 
						|
    {
 | 
						|
        mList.clear();
 | 
						|
        while (esm.isNextSub("ENAM"))
 | 
						|
        {
 | 
						|
            add(esm);
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    void EffectList::add(ESMReader& esm)
 | 
						|
    {
 | 
						|
        ENAMstruct s;
 | 
						|
        esm.getSubComposite(s);
 | 
						|
        mList.push_back(s);
 | 
						|
    }
 | 
						|
 | 
						|
    void EffectList::save(ESMWriter& esm) const
 | 
						|
    {
 | 
						|
        for (const ENAMstruct& enam : mList)
 | 
						|
        {
 | 
						|
            esm.writeNamedComposite("ENAM", enam);
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
} // end namespace
 |