2011-04-08 13:58:21 +00:00
|
|
|
#include "loadgmst.hpp"
|
|
|
|
|
2015-07-08 18:17:59 +00:00
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
2022-01-22 14:58:41 +00:00
|
|
|
#include "components/esm/defs.hpp"
|
2013-09-24 11:17:28 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2013-09-24 11:17:28 +00:00
|
|
|
unsigned int GameSetting::sRecordId = REC_GMST;
|
|
|
|
|
2015-07-20 14:23:14 +00:00
|
|
|
void GameSetting::load (ESMReader &esm, bool &isDeleted)
|
2011-04-08 13:58:21 +00:00
|
|
|
{
|
2015-07-20 14:23:14 +00:00
|
|
|
isDeleted = false; // GameSetting record can't be deleted now (may be changed in the future)
|
2021-07-25 09:53:41 +00:00
|
|
|
mRecordFlags = esm.getRecordFlags();
|
2015-07-20 14:23:14 +00:00
|
|
|
|
2015-07-08 18:17:59 +00:00
|
|
|
mId = esm.getHNString("NAME");
|
2013-03-05 07:02:27 +00:00
|
|
|
mValue.read (esm, ESM::Variant::Format_Gmst);
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|
|
|
|
|
2015-07-20 14:23:14 +00:00
|
|
|
void GameSetting::save (ESMWriter &esm, bool /*isDeleted*/) const
|
2011-04-08 13:58:21 +00:00
|
|
|
{
|
2015-07-08 18:17:59 +00:00
|
|
|
esm.writeHNCString("NAME", mId);
|
2013-03-05 07:02:27 +00:00
|
|
|
mValue.write (esm, ESM::Variant::Format_Gmst);
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|
2012-12-17 22:13:33 +00:00
|
|
|
|
2013-02-08 08:58:19 +00:00
|
|
|
void GameSetting::blank()
|
|
|
|
{
|
2013-03-05 07:02:27 +00:00
|
|
|
mValue.setType (ESM::VT_None);
|
2013-02-08 08:58:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool operator== (const GameSetting& left, const GameSetting& right)
|
|
|
|
{
|
2013-03-05 07:02:27 +00:00
|
|
|
return left.mValue==right.mValue;
|
2013-02-08 08:58:19 +00:00
|
|
|
}
|
2011-04-08 13:58:21 +00:00
|
|
|
}
|