1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00
OpenMW/components/esm3/effectlist.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
641 B
C++
Raw Normal View History

2012-09-17 11:37:50 +04:00
#include "effectlist.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
2012-09-17 11:37:50 +04:00
namespace ESM
{
2012-09-17 11:37:50 +04:00
void EffectList::load(ESMReader& esm)
{
mList.clear();
2012-09-17 11:37:50 +04:00
while (esm.isNextSub("ENAM"))
{
add(esm);
2022-09-22 21:26:05 +03:00
}
2012-09-17 11:37:50 +04:00
}
void EffectList::add(ESMReader& esm)
{
ENAMstruct s;
esm.getHTSized<24>(s);
mList.push_back(s);
}
void EffectList::save(ESMWriter& esm) const
2012-09-17 11:37:50 +04:00
{
for (std::vector<ENAMstruct>::const_iterator it = mList.begin(); it != mList.end(); ++it)
{
2012-09-17 11:37:50 +04:00
esm.writeHNT<ENAMstruct>("ENAM", *it, 24);
2022-09-22 21:26:05 +03:00
}
2012-09-17 11:37:50 +04:00
}
} // end namespace