1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/components/esm/loadgmst.cpp

50 lines
1.1 KiB
C++
Raw Normal View History

#include "loadgmst.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include "defs.hpp"
namespace ESM
{
unsigned int GameSetting::sRecordId = REC_GMST;
void GameSetting::load (ESMReader &esm, bool &isDeleted)
{
isDeleted = false; // GameSetting record can't be deleted now (may be changed in the future)
mId = esm.getHNString("NAME");
2013-03-05 08:02:27 +01:00
mValue.read (esm, ESM::Variant::Format_Gmst);
}
void GameSetting::save (ESMWriter &esm, bool /*isDeleted*/) const
{
esm.writeHNCString("NAME", mId);
2013-03-05 08:02:27 +01:00
mValue.write (esm, ESM::Variant::Format_Gmst);
}
2013-03-05 08:02:27 +01:00
int GameSetting::getInt() const
{
2013-03-05 08:02:27 +01:00
return mValue.getInteger();
}
2013-03-05 08:02:27 +01:00
float GameSetting::getFloat() const
{
2013-03-05 08:02:27 +01:00
return mValue.getFloat();
}
2013-03-05 08:02:27 +01:00
std::string GameSetting::getString() const
{
2013-03-05 08:02:27 +01:00
return mValue.getString();
}
2013-02-08 09:58:19 +01:00
void GameSetting::blank()
{
2013-03-05 08:02:27 +01:00
mValue.setType (ESM::VT_None);
2013-02-08 09:58:19 +01:00
}
bool operator== (const GameSetting& left, const GameSetting& right)
{
2013-03-05 08:02:27 +01:00
return left.mValue==right.mValue;
2013-02-08 09:58:19 +01:00
}
}