2011-04-06 16:11:08 +00:00
|
|
|
#include "loadbsgn.hpp"
|
|
|
|
|
2012-09-23 18:41:41 +00:00
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
2013-09-24 11:17:28 +00:00
|
|
|
#include "defs.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2011-04-06 16:11:08 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
unsigned int BirthSign::sRecordId = REC_BSGN;
|
2011-04-06 16:11:08 +00:00
|
|
|
|
|
|
|
void BirthSign::load(ESMReader &esm)
|
|
|
|
{
|
2015-02-12 03:56:05 +00:00
|
|
|
mPowers.mList.clear();
|
|
|
|
while (esm.hasMoreSubs())
|
|
|
|
{
|
|
|
|
esm.getSubName();
|
|
|
|
uint32_t name = esm.retSubName().val;
|
|
|
|
switch (name)
|
|
|
|
{
|
|
|
|
case ESM::FourCC<'F','N','A','M'>::value:
|
|
|
|
mName = esm.getHString();
|
|
|
|
break;
|
|
|
|
case ESM::FourCC<'T','N','A','M'>::value:
|
|
|
|
mTexture = esm.getHString();
|
|
|
|
break;
|
|
|
|
case ESM::FourCC<'D','E','S','C'>::value:
|
|
|
|
mDescription = esm.getHString();
|
|
|
|
break;
|
|
|
|
case ESM::FourCC<'N','P','C','S'>::value:
|
|
|
|
mPowers.add(esm);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
esm.fail("Unknown subrecord");
|
|
|
|
}
|
|
|
|
}
|
2011-04-06 16:11:08 +00:00
|
|
|
}
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2013-09-16 10:32:35 +00:00
|
|
|
void BirthSign::save(ESMWriter &esm) const
|
2012-04-06 19:04:30 +00:00
|
|
|
{
|
2014-04-13 11:23:50 +00:00
|
|
|
esm.writeHNOCString("FNAM", mName);
|
2012-09-17 07:37:50 +00:00
|
|
|
esm.writeHNOCString("TNAM", mTexture);
|
|
|
|
esm.writeHNOCString("DESC", mDescription);
|
2011-04-06 16:11:08 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
mPowers.save(esm);
|
2011-04-06 16:11:08 +00:00
|
|
|
}
|
|
|
|
|
2013-04-07 18:26:39 +00:00
|
|
|
void BirthSign::blank()
|
|
|
|
{
|
|
|
|
mName.clear();
|
|
|
|
mDescription.clear();
|
|
|
|
mTexture.clear();
|
|
|
|
mPowers.mList.clear();
|
|
|
|
}
|
|
|
|
|
2011-04-06 16:11:08 +00:00
|
|
|
}
|