OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadrace.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_RACE_H
2 #define OPENMW_ESM_RACE_H
3 
4 #include <string>
5 
6 #include "spelllist.hpp"
7 
8 namespace ESM
9 {
10 
11 class ESMReader;
12 class ESMWriter;
13 
14 /*
15  * Race definition
16  */
17 
18 struct Race
19 {
20  static unsigned int sRecordId;
22  static std::string getRecordType() { return "Race"; }
23 
24  struct SkillBonus
25  {
26  int mSkill; // SkillEnum
27  int mBonus;
28  };
29 
30  struct MaleFemale
31  {
32  int mMale, mFemale;
33 
34  int getValue (bool male) const;
35  };
36 
37  struct MaleFemaleF
38  {
39  float mMale, mFemale;
40 
41  int getValue (bool male) const;
42  };
43 
44  enum Flags
45  {
46  Playable = 0x01,
47  Beast = 0x02
48  };
49 
50  struct RADTstruct
51  {
52  // List of skills that get a bonus
54 
55  // Attribute values for male/female
57 
58  // The actual eye level height (in game units) is (probably) given
59  // as 'height' times 128. This has not been tested yet.
61 
62  int mFlags; // 0x1 - playable, 0x2 - beast race
63 
64  }; // Size = 140 bytes
65 
67 
68  std::string mId, mName, mDescription;
70 
71  void load(ESMReader &esm, bool &isDeleted);
72  void save(ESMWriter &esm, bool isDeleted = false) const;
73 
74  void blank();
76 };
77 
78 }
79 #endif
Definition: loadrace.hpp:46
int mMale
Definition: loadrace.hpp:32
MaleFemale mAttributeValues[8]
Definition: loadrace.hpp:56
int mFemale
Definition: loadrace.hpp:32
Definition: esmreader.hpp:21
SkillBonus mBonus[7]
Definition: loadrace.hpp:53
std::string mName
Definition: loadrace.hpp:68
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadrace.cpp:65
Flags
Definition: loadrace.hpp:44
float mMale
Definition: loadrace.hpp:39
Definition: esmwriter.hpp:17
SpellList mPowers
Definition: loadrace.hpp:69
int mFlags
Definition: loadrace.hpp:62
Definition: spelllist.hpp:16
float mFemale
Definition: loadrace.hpp:39
MaleFemaleF mWeight
Definition: loadrace.hpp:60
int mSkill
Definition: loadrace.hpp:26
RADTstruct mData
Definition: loadrace.hpp:66
void blank()
Set record to default state (does not touch the ID/index).
Definition: loadrace.cpp:81
Definition: loadrace.hpp:37
Definition: loadrace.hpp:30
Definition: loadrace.hpp:18
MaleFemaleF mHeight
Definition: loadrace.hpp:60
int mBonus
Definition: loadrace.hpp:27
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadrace.hpp:22
int getValue(bool male) const
Definition: loadrace.cpp:16
Definition: loadrace.hpp:47
static unsigned int sRecordId
Definition: loadrace.hpp:20
std::string mDescription
Definition: loadrace.hpp:68
Definition: loadrace.hpp:50
int getValue(bool male) const
Definition: loadrace.cpp:11
void load(ESMReader &esm, bool &isDeleted)
Definition: loadrace.cpp:21
std::string mId
Definition: loadrace.hpp:68
Definition: loadrace.hpp:24