#include "effectlist.hpp" #include "esmreader.hpp" #include "esmwriter.hpp" #include namespace ESM { template 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