1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 08:53:52 +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 07:37:50 +00:00
#include "effectlist.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
2012-09-17 07:37:50 +00:00
namespace ESM
{
2012-09-17 07:37:50 +00:00
void EffectList::load(ESMReader& esm)
{
mList.clear();
2012-09-17 07:37:50 +00:00
while (esm.isNextSub("ENAM"))
{
add(esm);
2022-09-22 18:26:05 +00:00
}
2012-09-17 07:37:50 +00: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 07:37:50 +00:00
{
for (std::vector<ENAMstruct>::const_iterator it = mList.begin(); it != mList.end(); ++it)
{
2012-09-17 07:37:50 +00:00
esm.writeHNT<ENAMstruct>("ENAM", *it, 24);
2022-09-22 18:26:05 +00:00
}
2012-09-17 07:37:50 +00:00
}
} // end namespace