OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadench.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_ENCH_H
2 #define OPENMW_ESM_ENCH_H
3 
4 #include <string>
5 
6 #include "effectlist.hpp"
7 
8 namespace ESM
9 {
10 
11 class ESMReader;
12 class ESMWriter;
13 
14 /*
15  * Enchantments
16  */
17 
19 {
20  static unsigned int sRecordId;
22  static std::string getRecordType() { return "Enchantment"; }
23 
24  enum Type
25  {
26  CastOnce = 0,
28  WhenUsed = 2,
30  };
31 
32  struct ENDTstruct
33  {
34  int mType;
35  int mCost;
36  int mCharge;
37  int mAutocalc; // Guessing this is 1 if we are supposed to auto
38  // calculate
39  };
40 
41  std::string mId;
44 
45  void load(ESMReader &esm, bool &isDeleted);
46  void save(ESMWriter &esm, bool isDeleted = false) const;
47 
48  void blank();
50 };
51 }
52 #endif
EffectList mEffects
Definition: loadench.hpp:43
Type
Definition: loadench.hpp:24
Definition: loadench.hpp:32
Definition: esmreader.hpp:21
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadench.hpp:22
static unsigned int sRecordId
Definition: loadench.hpp:20
Definition: loadench.hpp:29
int mCost
Definition: loadench.hpp:35
ENDTstruct mData
Definition: loadench.hpp:42
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadench.cpp:50
void blank()
Set record to default state (does not touch the ID).
Definition: loadench.cpp:64
Definition: esmwriter.hpp:17
Definition: loadench.hpp:27
Definition: loadench.hpp:28
std::string mId
Definition: loadench.hpp:41
void load(ESMReader &esm, bool &isDeleted)
Definition: loadench.cpp:11
Definition: loadench.hpp:26
Definition: loadench.hpp:18
int mCharge
Definition: loadench.hpp:36
EffectList, ENAM subrecord.
Definition: effectlist.hpp:33
int mAutocalc
Definition: loadench.hpp:37
int mType
Definition: loadench.hpp:34