OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadskil.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_ESM_SKIL_H
2 #define OPENMW_ESM_SKIL_H
3 
4 #include <string>
5 
6 #include <boost/array.hpp>
7 
8 #include "defs.hpp"
9 
10 namespace ESM {
11 
12 class ESMReader;
13 class ESMWriter;
14 
15 /*
16  * Skill information
17  *
18  */
19 
20 struct Skill
21 {
22  static unsigned int sRecordId;
24  static std::string getRecordType() { return "Skill"; }
25 
26  std::string mId;
27 
28  struct SKDTstruct
29  {
30  int mAttribute; // see defs.hpp
31  int mSpecialization;// 0 - Combat, 1 - Magic, 2 - Stealth
32  float mUseValue[4]; // How much skill improves through use. Meaning
33  // of each field depends on what skill this
34  // is. We should document this better later.
35  }; // Total size: 24 bytes
37 
38  // Skill index. Skils don't have an id ("NAME") like most records,
39  // they only have a numerical index that matches one of the
40  // hard-coded skills in the game.
41  int mIndex;
42 
43  std::string mDescription;
44 
45  enum SkillEnum
46  {
47  Block = 0,
48  Armorer = 1,
52  LongBlade = 5,
53  Axe = 6,
54  Spear = 7,
55  Athletics = 8,
56  Enchant = 9,
58  Alteration = 11,
59  Illusion = 12,
61  Mysticism = 14,
63  Alchemy = 16,
64  Unarmored = 17,
65  Security = 18,
66  Sneak = 19,
67  Acrobatics = 20,
68  LightArmor = 21,
69  ShortBlade = 22,
70  Marksman = 23,
71  Mercantile = 24,
73  HandToHand = 26,
75  };
76  static const std::string sSkillNames[Length];
77  static const std::string sSkillNameIds[Length];
78  static const std::string sIconNames[Length];
79  static const boost::array<SkillEnum, Length> sSkillIds;
80 
81  void load(ESMReader &esm, bool &isDeleted);
82  void save(ESMWriter &esm, bool isDeleted = false) const;
83 
84  void blank();
86 
87  static std::string indexToId (int index);
88 };
89 }
90 #endif
static unsigned int sRecordId
Definition: loadskil.hpp:22
SKDTstruct mData
Definition: loadskil.hpp:36
Definition: loadskil.hpp:67
Definition: loadskil.hpp:70
Definition: loadskil.hpp:55
Definition: loadskil.hpp:72
Definition: loadskil.hpp:49
Definition: loadskil.hpp:65
Definition: esmreader.hpp:21
void load(ESMReader &esm, bool &isDeleted)
Definition: loadskil.cpp:132
Definition: loadskil.hpp:20
void blank()
Set record to default state (does not touch the ID/index).
Definition: loadskil.cpp:175
static std::string getRecordType()
Return a string descriptor for this record type. Currently used for debugging / error logs only...
Definition: loadskil.hpp:24
Definition: loadskil.hpp:47
Definition: loadskil.hpp:74
Definition: loadskil.hpp:58
static const std::string sSkillNames[Length]
Definition: loadskil.hpp:76
Definition: loadskil.hpp:57
Definition: loadskil.hpp:54
Definition: loadskil.hpp:52
std::string mId
Definition: loadskil.hpp:26
void save(ESMWriter &esm, bool isDeleted=false) const
Definition: loadskil.cpp:168
Definition: esmwriter.hpp:17
Definition: loadskil.hpp:53
static const boost::array< SkillEnum, Length > sSkillIds
Definition: loadskil.hpp:79
Definition: loadskil.hpp:28
Definition: loadskil.hpp:68
static const std::string sSkillNameIds[Length]
Definition: loadskil.hpp:77
Definition: loadskil.hpp:56
static const std::string sIconNames[Length]
Definition: loadskil.hpp:78
Definition: loadskil.hpp:62
int mIndex
Definition: loadskil.hpp:41
static std::string indexToId(int index)
Definition: loadskil.cpp:183
Definition: loadskil.hpp:71
Definition: loadskil.hpp:61
Definition: loadskil.hpp:64
float mUseValue[4]
Definition: loadskil.hpp:32
Definition: loadskil.hpp:50
Definition: loadskil.hpp:69
Definition: loadskil.hpp:73
SkillEnum
Definition: loadskil.hpp:45
int mSpecialization
Definition: loadskil.hpp:31
Definition: loadskil.hpp:63
Definition: loadskil.hpp:59
std::string mDescription
Definition: loadskil.hpp:43
Definition: loadskil.hpp:66
Definition: loadskil.hpp:51
Definition: loadskil.hpp:60
Definition: loadskil.hpp:48
int mAttribute
Definition: loadskil.hpp:30