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

47 lines
894 B
C++
Raw Normal View History

2012-09-23 22:11:08 +04:00
#ifndef OPENMW_ESM_GMST_H
#define OPENMW_ESM_GMST_H
2010-02-22 21:00:38 +01:00
2012-09-17 11:37:50 +04:00
#include <string>
2013-03-04 13:59:06 +01:00
#include "variant.hpp"
2010-02-22 21:00:38 +01:00
namespace ESM
{
2012-10-01 00:51:54 +04:00
class ESMReader;
class ESMWriter;
2010-02-22 21:00:38 +01:00
/*
* Game setting, with automatic cleaning of "dirty" entries.
*
*/
struct GameSetting
2010-02-22 21:00:38 +01:00
{
std::string mId;
2013-03-05 08:02:27 +01:00
Variant mValue;
void load(ESMReader &esm);
2013-02-08 09:58:19 +01:00
2013-03-05 08:02:27 +01:00
/// \todo remove the get* functions (redundant, since mValue as equivalent functions now).
int getInt() const;
///< Throws an exception if GMST is not of type int or float.
2013-02-08 09:58:19 +01:00
float getFloat() const;
///< Throws an exception if GMST is not of type int or float.
2013-02-08 09:58:19 +01:00
std::string getString() const;
///< Throwns an exception if GMST is not of type string.
2012-09-17 11:37:50 +04:00
void save(ESMWriter &esm);
2013-02-08 09:58:19 +01:00
void blank();
///< Set record to default state (does not touch the ID).
2010-02-22 21:00:38 +01:00
};
2013-02-08 09:58:19 +01:00
bool operator== (const GameSetting& left, const GameSetting& right);
2010-02-22 21:00:38 +01:00
}
#endif