2011-04-08 17:58:21 +04:00
|
|
|
#include "loadgmst.hpp"
|
|
|
|
|
2013-09-24 13:17:28 +02:00
|
|
|
#include "defs.hpp"
|
|
|
|
|
2011-04-08 17:58:21 +04:00
|
|
|
namespace ESM
|
|
|
|
{
|
2013-09-24 13:17:28 +02:00
|
|
|
unsigned int GameSetting::sRecordId = REC_GMST;
|
|
|
|
|
2013-03-05 08:02:27 +01:00
|
|
|
void GameSetting::load (ESMReader &esm)
|
2011-04-08 17:58:21 +04:00
|
|
|
{
|
2013-03-05 08:02:27 +01:00
|
|
|
mValue.read (esm, ESM::Variant::Format_Gmst);
|
2011-04-08 17:58:21 +04:00
|
|
|
}
|
|
|
|
|
2013-09-16 12:32:35 +02:00
|
|
|
void GameSetting::save (ESMWriter &esm) const
|
2011-04-08 17:58:21 +04:00
|
|
|
{
|
2013-03-05 08:02:27 +01:00
|
|
|
mValue.write (esm, ESM::Variant::Format_Gmst);
|
2011-04-08 17:58:21 +04:00
|
|
|
}
|
2012-12-17 23:13:33 +01:00
|
|
|
|
2013-03-05 08:02:27 +01:00
|
|
|
int GameSetting::getInt() const
|
2012-04-06 21:04:30 +02:00
|
|
|
{
|
2013-03-05 08:02:27 +01:00
|
|
|
return mValue.getInteger();
|
2012-04-06 21:04:30 +02:00
|
|
|
}
|
2011-04-08 17:58:21 +04:00
|
|
|
|
2013-03-05 08:02:27 +01:00
|
|
|
float GameSetting::getFloat() const
|
2012-09-13 10:41:55 +02:00
|
|
|
{
|
2013-03-05 08:02:27 +01:00
|
|
|
return mValue.getFloat();
|
2012-09-13 10:41:55 +02:00
|
|
|
}
|
|
|
|
|
2013-03-05 08:02:27 +01:00
|
|
|
std::string GameSetting::getString() const
|
2012-09-13 10:41:55 +02:00
|
|
|
{
|
2013-03-05 08:02:27 +01:00
|
|
|
return mValue.getString();
|
2012-09-13 10:41:55 +02:00
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
2011-04-08 17:58:21 +04:00
|
|
|
}
|