2012-09-17 07:37:50 +00:00
|
|
|
#include "effectlist.hpp"
|
|
|
|
|
2012-09-23 18:41:41 +00:00
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2022-04-11 22:18:39 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
|
|
|
|
void EffectList::load(ESMReader& esm)
|
|
|
|
{
|
2014-09-20 11:32:32 +00:00
|
|
|
mList.clear();
|
2012-09-17 07:37:50 +00:00
|
|
|
while (esm.isNextSub("ENAM"))
|
|
|
|
{
|
2015-02-12 03:56:05 +00:00
|
|
|
add(esm);
|
2022-09-22 18:26:05 +00:00
|
|
|
}
|
2012-09-17 07:37:50 +00:00
|
|
|
}
|
|
|
|
|
2015-02-12 03:56:05 +00:00
|
|
|
void EffectList::add(ESMReader& esm)
|
|
|
|
{
|
|
|
|
ENAMstruct s;
|
2022-04-10 11:35:00 +00:00
|
|
|
esm.getHTSized<24>(s);
|
2015-02-12 03:56:05 +00:00
|
|
|
mList.push_back(s);
|
|
|
|
}
|
|
|
|
|
2013-09-16 10:32:35 +00:00
|
|
|
void EffectList::save(ESMWriter& esm) const
|
2012-09-17 07:37:50 +00:00
|
|
|
{
|
2013-09-16 10:32:35 +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
|