OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadmisc.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_MISC_H
2 #define OPENMW_ESM_MISC_H
3 
4 #include <string>
5 
6 namespace ESM
7 {
8 
9 class ESMReader;
10 class ESMWriter;
11 
12 /*
13  * Misc inventory items, basically things that have no use but can be
14  * carried, bought and sold. It also includes keys.
15  */
16 
18 {
19  static unsigned int sRecordId;
21  static std::string getRecordType() { return "Miscellaneous"; }
22 
23  struct MCDTstruct
24  {
25  float mWeight;
26  int mValue;
27  int mIsKey; // There are many keys in Morrowind.esm that has this
28  // set to 0. TODO: Check what this field corresponds to
29  // in the editor.
30  };
32 
33  std::string mId, mName, mModel, mIcon, mScript;
34 
35  void load(ESMReader &esm, bool &isDeleted);
36  void save(ESMWriter &esm, bool isDeleted = false) const;
37 
38  void blank();
40 };
41 }
42 #endif
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadmisc.hpp:21
static unsigned int sRecordId
Definition: loadmisc.hpp:19
Definition: esmreader.hpp:21
float mWeight
Definition: loadmisc.hpp:25
std::string mName
Definition: loadmisc.hpp:33
std::string mScript
Definition: loadmisc.hpp:33
void blank()
Set record to default state (does not touch the ID).
Definition: loadmisc.cpp:75
Definition: esmwriter.hpp:17
Definition: loadmisc.hpp:23
std::string mId
Definition: loadmisc.hpp:33
void load(ESMReader &esm, bool &isDeleted)
Definition: loadmisc.cpp:11
int mIsKey
Definition: loadmisc.hpp:27
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadmisc.cpp:58
int mValue
Definition: loadmisc.hpp:26
std::string mModel
Definition: loadmisc.hpp:33
MCDTstruct mData
Definition: loadmisc.hpp:31
std::string mIcon
Definition: loadmisc.hpp:33
Definition: loadmisc.hpp:17