OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadarmo.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_ARMO_H
2 #define OPENMW_ESM_ARMO_H
3 
4 #include <vector>
5 #include <string>
6 
7 namespace ESM
8 {
9 
10 class ESMReader;
11 class ESMWriter;
12 
14 {
15  PRT_Head = 0,
16  PRT_Hair = 1,
17  PRT_Neck = 2,
19  PRT_Groin = 4,
20  PRT_Skirt = 5,
21  PRT_RHand = 6,
22  PRT_LHand = 7,
25  PRT_Shield = 10,
30  PRT_RFoot = 15,
31  PRT_LFoot = 16,
32  PRT_RAnkle = 17,
33  PRT_LAnkle = 18,
34  PRT_RKnee = 19,
35  PRT_LKnee = 20,
36  PRT_RLeg = 21,
37  PRT_LLeg = 22,
40  PRT_Weapon = 25,
41  PRT_Tail = 26,
42 
43  PRT_Count = 27
44 };
45 
46 // Reference to body parts
48 {
49  unsigned char mPart; // possible values [0, 26]
50  std::string mMale, mFemale;
51 };
52 
53 // A list of references to body parts
55 {
56  std::vector<PartReference> mParts;
57 
59  void add(ESMReader &esm);
60 
62  void load(ESMReader &esm);
63  void save(ESMWriter &esm) const;
64 };
65 
66 struct Armor
67 {
68  static unsigned int sRecordId;
70  static std::string getRecordType() { return "Armor"; }
71 
72  enum Type
73  {
74  Helmet = 0,
75  Cuirass = 1,
76  LPauldron = 2,
77  RPauldron = 3,
78  Greaves = 4,
79  Boots = 5,
80  LGauntlet = 6,
81  RGauntlet = 7,
82  Shield = 8,
83  LBracer = 9,
84  RBracer = 10
85  };
86 
87  struct AODTstruct
88  {
89  int mType;
90  float mWeight;
92  };
93 
96 
97  std::string mId, mName, mModel, mIcon, mScript, mEnchant;
98 
99  void load(ESMReader &esm, bool &isDeleted);
100  void save(ESMWriter &esm, bool isDeleted = false) const;
101 
102  void blank();
104 };
105 }
106 #endif
Definition: loadarmo.hpp:28
Definition: loadarmo.hpp:23
Definition: loadarmo.hpp:47
int mHealth
Definition: loadarmo.hpp:91
std::string mMale
Definition: loadarmo.hpp:50
Definition: loadarmo.hpp:36
Definition: esmreader.hpp:21
PartReferenceType
Definition: loadarmo.hpp:13
Definition: loadarmo.hpp:54
Definition: loadarmo.hpp:66
unsigned char mPart
Definition: loadarmo.hpp:49
std::string mName
Definition: loadarmo.hpp:97
Definition: loadarmo.hpp:37
Definition: loadarmo.hpp:25
static unsigned int sRecordId
Definition: loadarmo.hpp:68
std::string mModel
Definition: loadarmo.hpp:97
Definition: loadarmo.hpp:78
Type
Definition: loadarmo.hpp:72
Definition: loadarmo.hpp:18
Definition: loadarmo.hpp:82
Definition: loadarmo.hpp:16
std::string mId
Definition: loadarmo.hpp:97
std::string mEnchant
Definition: loadarmo.hpp:97
void save(ESMWriter &esm) const
Definition: loadarmo.cpp:29
std::string mIcon
Definition: loadarmo.hpp:97
Definition: loadarmo.hpp:34
Definition: esmwriter.hpp:17
Definition: loadarmo.hpp:81
int mEnchant
Definition: loadarmo.hpp:91
Definition: loadarmo.hpp:83
Definition: loadarmo.hpp:76
Definition: loadarmo.hpp:84
Definition: loadarmo.hpp:22
Definition: loadarmo.hpp:19
int mValue
Definition: loadarmo.hpp:91
Definition: loadarmo.hpp:33
float mWeight
Definition: loadarmo.hpp:90
Definition: loadarmo.hpp:87
void load(ESMReader &esm, bool &isDeleted)
Definition: loadarmo.cpp:41
AODTstruct mData
Definition: loadarmo.hpp:94
Definition: loadarmo.hpp:30
void load(ESMReader &esm)
TODO: remove this method. The ESM format does not guarantee that all Part subrecords follow one anoth...
Definition: loadarmo.cpp:20
Definition: loadarmo.hpp:32
Definition: loadarmo.hpp:24
Definition: loadarmo.hpp:39
Definition: loadarmo.hpp:74
void add(ESMReader &esm)
Load one part, assumes the subrecord name was already read.
Definition: loadarmo.cpp:10
int mType
Definition: loadarmo.hpp:89
Definition: loadarmo.hpp:79
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadarmo.cpp:96
Definition: loadarmo.hpp:40
Definition: loadarmo.hpp:31
std::vector< PartReference > mParts
Definition: loadarmo.hpp:56
int mArmor
Definition: loadarmo.hpp:91
Definition: loadarmo.hpp:75
Definition: loadarmo.hpp:80
Definition: loadarmo.hpp:17
PartReferenceList mParts
Definition: loadarmo.hpp:95
Definition: loadarmo.hpp:38
Definition: loadarmo.hpp:35
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadarmo.hpp:70
Definition: loadarmo.hpp:26
Definition: loadarmo.hpp:21
std::string mFemale
Definition: loadarmo.hpp:50
Definition: loadarmo.hpp:41
Definition: loadarmo.hpp:77
Definition: loadarmo.hpp:29
Definition: loadarmo.hpp:27
Definition: loadarmo.hpp:20
Definition: loadarmo.hpp:43
Definition: loadarmo.hpp:15
std::string mScript
Definition: loadarmo.hpp:97
void blank()
Set record to default state (does not touch the ID).
Definition: loadarmo.cpp:115