2011-04-08 13:58:21 +00:00
|
|
|
#include "loadstat.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"
|
2015-07-07 12:37:42 +00:00
|
|
|
#include "util.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
unsigned int Static::sRecordId = REC_STAT;
|
2011-04-08 13:58:21 +00:00
|
|
|
|
2015-07-09 18:45:24 +00:00
|
|
|
Static::Static()
|
|
|
|
: mIsDeleted(false)
|
|
|
|
{}
|
|
|
|
|
2015-02-12 03:56:05 +00:00
|
|
|
void Static::load(ESMReader &esm)
|
|
|
|
{
|
2015-07-07 12:37:42 +00:00
|
|
|
mId = esm.getHNString("NAME");
|
|
|
|
if (mIsDeleted = readDeleSubRecord(esm))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-02-12 03:56:05 +00:00
|
|
|
mModel = esm.getHNString("MODL");
|
|
|
|
}
|
|
|
|
void Static::save(ESMWriter &esm) const
|
|
|
|
{
|
2015-07-07 12:37:42 +00:00
|
|
|
esm.writeHNCString("NAME", mId);
|
|
|
|
if (mIsDeleted)
|
|
|
|
{
|
|
|
|
writeDeleSubRecord(esm);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-02-12 03:56:05 +00:00
|
|
|
esm.writeHNCString("MODL", mModel);
|
|
|
|
}
|
2011-04-08 13:58:21 +00:00
|
|
|
|
2013-05-06 12:10:43 +00:00
|
|
|
void Static::blank()
|
|
|
|
{
|
|
|
|
mModel.clear();
|
2015-07-07 12:37:42 +00:00
|
|
|
mIsDeleted = false;
|
2013-05-06 12:10:43 +00:00
|
|
|
}
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|