1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:53:53 +00:00
openmw/components/esm3/effectlist.cpp

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

32 lines
549 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);
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);
}
}
} // end namespace