2011-04-06 16:11:08 +00:00
|
|
|
#include "loadacti.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 Activator::sRecordId = REC_ACTI;
|
|
|
|
|
2015-02-12 03:56:05 +00:00
|
|
|
void Activator::load(ESMReader &esm)
|
|
|
|
{
|
|
|
|
while (esm.hasMoreSubs())
|
|
|
|
{
|
|
|
|
esm.getSubName();
|
|
|
|
uint32_t name = esm.retSubName().val;
|
|
|
|
switch (name)
|
|
|
|
{
|
|
|
|
case ESM::FourCC<'M','O','D','L'>::value:
|
|
|
|
mModel = esm.getHString();
|
|
|
|
break;
|
|
|
|
case ESM::FourCC<'F','N','A','M'>::value:
|
|
|
|
mName = esm.getHString();
|
|
|
|
break;
|
|
|
|
case ESM::FourCC<'S','C','R','I'>::value:
|
|
|
|
mScript = esm.getHString();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
esm.fail("Unknown subrecord");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void Activator::save(ESMWriter &esm) const
|
|
|
|
{
|
|
|
|
esm.writeHNCString("MODL", mModel);
|
|
|
|
esm.writeHNOCString("FNAM", mName);
|
|
|
|
esm.writeHNOCString("SCRI", mScript);
|
|
|
|
}
|
2013-05-06 12:10:43 +00:00
|
|
|
|
|
|
|
void Activator::blank()
|
|
|
|
{
|
|
|
|
mName.clear();
|
|
|
|
mScript.clear();
|
|
|
|
mModel.clear();
|
|
|
|
}
|
2011-04-06 16:11:08 +00:00
|
|
|
}
|