2011-04-08 13:58:21 +00:00
|
|
|
#include "loadspel.hpp"
|
|
|
|
|
2012-09-23 18:41:41 +00:00
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
|
|
|
|
void Spell::load(ESMReader &esm)
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
mName = esm.getHNOString("FNAM");
|
|
|
|
esm.getHNT(mData, "SPDT", 12);
|
|
|
|
mEffects.load(esm);
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2013-09-16 10:32:35 +00:00
|
|
|
void Spell::save(ESMWriter &esm) const
|
2012-04-06 19:04:30 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
esm.writeHNOCString("FNAM", mName);
|
|
|
|
esm.writeHNT("SPDT", mData, 12);
|
|
|
|
mEffects.save(esm);
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|
|
|
|
|
2013-04-09 09:40:36 +00:00
|
|
|
void Spell::blank()
|
|
|
|
{
|
|
|
|
mData.mType = 0;
|
|
|
|
mData.mCost = 0;
|
|
|
|
mData.mFlags = 0;
|
|
|
|
|
|
|
|
mName.clear();
|
|
|
|
|
|
|
|
mEffects.mList.clear();
|
|
|
|
}
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|