OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadclas.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_CLAS_H
2 #define OPENMW_ESM_CLAS_H
3 
4 #include <string>
5 
6 namespace ESM
7 {
8 
9 class ESMReader;
10 class ESMWriter;
11 
12 /*
13  * Character class definitions
14  */
15 
16 // These flags tells us which items should be auto-calculated for this
17 // class
18 struct Class
19 {
20  static unsigned int sRecordId;
22  static std::string getRecordType() { return "Class"; }
23 
24  enum AutoCalc
25  {
26  Weapon = 0x00001,
27  Armor = 0x00002,
28  Clothing = 0x00004,
29  Books = 0x00008,
30  Ingredient = 0x00010,
31  Lockpick = 0x00020,
32  Probe = 0x00040,
33  Lights = 0x00080,
34  Apparatus = 0x00100,
35  Repair = 0x00200,
36  Misc = 0x00400,
37  Spells = 0x00800,
38  MagicItems = 0x01000,
39  Potions = 0x02000,
40  Training = 0x04000,
41  Spellmaking = 0x08000,
42  Enchanting = 0x10000,
43  RepairItem = 0x20000
44  };
45 
47  {
48  Combat = 0,
49  Magic = 1,
50  Stealth = 2
51  };
52 
54  static const char *sGmstSpecializationIds[3];
55 
56  struct CLDTstruct
57  {
58  int mAttribute[2]; // Attributes that get class bonus
59  int mSpecialization; // 0 = Combat, 1 = Magic, 2 = Stealth
60  int mSkills[5][2]; // Minor and major skills.
61  int mIsPlayable; // 0x0001 - Playable class
62 
63  // I have no idea how to autocalculate these items...
64  int mCalc;
65 
66  int& getSkill (int index, bool major);
68 
69  int getSkill (int index, bool major) const;
71  }; // 60 bytes
72 
73  std::string mId, mName, mDescription;
75 
76  void load(ESMReader &esm, bool &isDeleted);
77  void save(ESMWriter &esm, bool isDeleted = false) const;
78 
79  void blank();
81 
82 };
83 }
84 #endif
std::string mName
Definition: loadclas.hpp:73
Definition: loadclas.hpp:42
Definition: loadingr.hpp:16
Definition: esmreader.hpp:21
Definition: loadprob.hpp:12
Definition: loadclas.hpp:41
Definition: loadarmo.hpp:66
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadclas.cpp:83
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadclas.hpp:22
void load(ESMReader &esm, bool &isDeleted)
Definition: loadclas.cpp:41
void blank()
Set record to default state (does not touch the ID/index).
Definition: loadclas.cpp:98
Definition: loadclas.hpp:36
int mSkills[5][2]
Definition: loadclas.hpp:60
int mCalc
Definition: loadclas.hpp:64
Definition: loadclas.hpp:29
Definition: esmwriter.hpp:17
int mIsPlayable
Definition: loadclas.hpp:61
int mAttribute[2]
Definition: loadclas.hpp:58
Definition: loadclas.hpp:56
Definition: loadappa.hpp:16
Definition: loadclas.hpp:38
std::string mId
Definition: loadclas.hpp:73
Definition: loadclas.hpp:33
static unsigned int sRecordId
Definition: loadclas.hpp:20
Definition: loadclas.hpp:39
CLDTstruct mData
Definition: loadclas.hpp:74
Definition: loadlock.hpp:12
Definition: loadclas.hpp:50
static const Specialization sSpecializationIds[3]
Definition: loadclas.hpp:53
Definition: loadclot.hpp:18
Specialization
Definition: loadclas.hpp:46
static const char * sGmstSpecializationIds[3]
Definition: loadclas.hpp:54
Definition: loadclas.hpp:18
Definition: loadclas.hpp:48
int & getSkill(int index, bool major)
Throws an exception for invalid values of index.
Definition: loadclas.cpp:25
Definition: loadclas.hpp:40
Definition: loadclas.hpp:49
int mSpecialization
Definition: loadclas.hpp:59
AutoCalc
Definition: loadclas.hpp:24
Definition: loadclas.hpp:37
std::string mDescription
Definition: loadclas.hpp:73
Definition: loadclas.hpp:43
Definition: loadweap.hpp:16
Definition: loadrepa.hpp:12