OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadweap.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_WEAP_H
2 #define OPENMW_ESM_WEAP_H
3 
4 #include <string>
5 
6 namespace ESM
7 {
8 
9 class ESMReader;
10 class ESMWriter;
11 
12 /*
13  * Weapon definition
14  */
15 
16 struct Weapon
17 {
18  static unsigned int sRecordId;
20  static std::string getRecordType() { return "Weapon"; }
21 
22  enum Type
23  {
36  Arrow = 12,
37  Bolt = 13
38  };
39 
41  {
45  };
46 
47  enum Flags
48  {
49  Magical = 0x01,
50  Silver = 0x02
51  };
52 
53 #pragma pack(push)
54 #pragma pack(1)
55  struct WPDTstruct
56  {
57  float mWeight;
58  int mValue;
59  short mType;
60  short mHealth;
61  float mSpeed, mReach;
62  short mEnchant; // Enchantment points. The real value is mEnchant/10.f
63  unsigned char mChop[2], mSlash[2], mThrust[2]; // Min and max
64  int mFlags;
65  }; // 32 bytes
66 #pragma pack(pop)
67 
69 
70  std::string mId, mName, mModel, mIcon, mEnchant, mScript;
71 
72  void load(ESMReader &esm, bool &isDeleted);
73  void save(ESMWriter &esm, bool isDeleted = false) const;
74 
75  void blank();
77 };
78 }
79 #endif
Definition: loadweap.hpp:42
Definition: loadweap.hpp:30
Type
Definition: loadweap.hpp:22
float mSpeed
Definition: loadweap.hpp:61
void blank()
Set record to default state (does not touch the ID).
Definition: loadweap.cpp:77
Definition: loadweap.hpp:26
Definition: loadweap.hpp:33
Definition: loadweap.hpp:49
unsigned char mChop[2]
Definition: loadweap.hpp:63
Definition: esmreader.hpp:21
Flags
Definition: loadweap.hpp:47
int mFlags
Definition: loadweap.hpp:64
short mType
Definition: loadweap.hpp:59
Definition: loadweap.hpp:37
Definition: loadweap.hpp:28
std::string mModel
Definition: loadweap.hpp:70
Definition: loadweap.hpp:32
float mWeight
Definition: loadweap.hpp:57
std::string mIcon
Definition: loadweap.hpp:70
Definition: esmwriter.hpp:17
AttackType
Definition: loadweap.hpp:40
int mValue
Definition: loadweap.hpp:58
short mEnchant
Definition: loadweap.hpp:62
static unsigned int sRecordId
Definition: loadweap.hpp:18
Definition: loadweap.hpp:36
Definition: loadweap.hpp:27
std::string mId
Definition: loadweap.hpp:70
Definition: loadweap.hpp:34
Definition: loadweap.hpp:50
Definition: loadweap.hpp:25
Definition: loadweap.hpp:35
unsigned char mThrust[2]
Definition: loadweap.hpp:63
void load(ESMReader &esm, bool &isDeleted)
Definition: loadweap.cpp:11
std::string mName
Definition: loadweap.hpp:70
float mReach
Definition: loadweap.hpp:61
Definition: loadweap.hpp:43
short mHealth
Definition: loadweap.hpp:60
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadweap.cpp:59
Definition: loadweap.hpp:44
Definition: loadweap.hpp:29
unsigned char mSlash[2]
Definition: loadweap.hpp:63
Definition: loadweap.hpp:55
WPDTstruct mData
Definition: loadweap.hpp:68
Definition: loadweap.hpp:24
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadweap.hpp:20
std::string mEnchant
Definition: loadweap.hpp:70
std::string mScript
Definition: loadweap.hpp:70
Definition: loadweap.hpp:31
Definition: loadweap.hpp:16