2012-09-23 18:11:08 +00:00
|
|
|
#ifndef OPENMW_ESM_GMST_H
|
|
|
|
#define OPENMW_ESM_GMST_H
|
2010-02-22 20:00:38 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
#include <string>
|
|
|
|
|
2010-02-22 20:00:38 +00:00
|
|
|
#include "defs.hpp"
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2012-09-30 20:51:54 +00:00
|
|
|
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2010-02-22 20:00:38 +00:00
|
|
|
/*
|
|
|
|
* Game setting, with automatic cleaning of "dirty" entries.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-09-30 19:34:53 +00:00
|
|
|
struct GameSetting
|
2010-02-22 20:00:38 +00:00
|
|
|
{
|
2012-09-30 19:34:53 +00:00
|
|
|
std::string mId;
|
2011-04-08 13:58:21 +00:00
|
|
|
// One of these is used depending on the variable type
|
2012-09-17 07:37:50 +00:00
|
|
|
std::string mStr;
|
|
|
|
int mI;
|
|
|
|
float mF;
|
|
|
|
VarType mType;
|
2011-04-08 13:58:21 +00:00
|
|
|
|
|
|
|
void load(ESMReader &esm);
|
2012-09-13 08:41:55 +00:00
|
|
|
|
|
|
|
int getInt() const;
|
|
|
|
///< Throws an exception if GMST is not of type int or float.
|
|
|
|
|
2012-09-21 15:53:16 +00:00
|
|
|
float getFloat() const;
|
2012-09-13 08:41:55 +00:00
|
|
|
///< Throws an exception if GMST is not of type int or float.
|
|
|
|
|
|
|
|
std::string getString() const;
|
|
|
|
///< Throwns an exception if GMST is not of type string.
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2012-04-06 19:04:30 +00:00
|
|
|
void save(ESMWriter &esm);
|
2010-02-22 20:00:38 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|