2012-09-23 22:11:08 +04:00
|
|
|
#ifndef OPENMW_ESM_CLAS_H
|
|
|
|
#define OPENMW_ESM_CLAS_H
|
2010-02-21 17:55:12 +01:00
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
#include <string>
|
|
|
|
|
2011-04-06 20:11:08 +04:00
|
|
|
namespace ESM
|
|
|
|
{
|
2012-10-01 00:51:54 +04:00
|
|
|
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2010-02-21 17:55:12 +01:00
|
|
|
/*
|
|
|
|
* Character class definitions
|
|
|
|
*/
|
|
|
|
|
|
|
|
// These flags tells us which items should be auto-calculated for this
|
|
|
|
// class
|
2012-09-30 23:34:53 +04:00
|
|
|
struct Class
|
2010-02-21 17:55:12 +01:00
|
|
|
{
|
2013-09-24 13:17:28 +02:00
|
|
|
static unsigned int sRecordId;
|
2015-06-14 02:31:00 +02:00
|
|
|
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
|
|
|
static std::string getRecordType() { return "Class"; }
|
2013-09-24 13:17:28 +02:00
|
|
|
|
2011-04-06 20:11:08 +04:00
|
|
|
enum AutoCalc
|
2010-02-21 17:55:12 +01:00
|
|
|
{
|
2011-04-06 20:11:08 +04:00
|
|
|
Weapon = 0x00001,
|
|
|
|
Armor = 0x00002,
|
|
|
|
Clothing = 0x00004,
|
|
|
|
Books = 0x00008,
|
|
|
|
Ingredient = 0x00010,
|
|
|
|
Lockpick = 0x00020,
|
|
|
|
Probe = 0x00040,
|
|
|
|
Lights = 0x00080,
|
|
|
|
Apparatus = 0x00100,
|
|
|
|
Repair = 0x00200,
|
|
|
|
Misc = 0x00400,
|
|
|
|
Spells = 0x00800,
|
|
|
|
MagicItems = 0x01000,
|
|
|
|
Potions = 0x02000,
|
|
|
|
Training = 0x04000,
|
|
|
|
Spellmaking = 0x08000,
|
|
|
|
Enchanting = 0x10000,
|
|
|
|
RepairItem = 0x20000
|
2010-02-21 17:55:12 +01:00
|
|
|
};
|
|
|
|
|
2011-04-06 20:11:08 +04:00
|
|
|
enum Specialization
|
2010-09-19 04:29:22 +02:00
|
|
|
{
|
2011-04-08 22:26:27 +04:00
|
|
|
Combat = 0,
|
|
|
|
Magic = 1,
|
|
|
|
Stealth = 2
|
2010-09-19 04:29:22 +02:00
|
|
|
};
|
|
|
|
|
2012-09-17 11:37:50 +04:00
|
|
|
static const Specialization sSpecializationIds[3];
|
|
|
|
static const char *sGmstSpecializationIds[3];
|
2010-02-21 17:55:12 +01:00
|
|
|
|
2011-04-06 20:11:08 +04:00
|
|
|
struct CLDTstruct
|
2010-02-21 17:55:12 +01:00
|
|
|
{
|
2012-09-17 11:37:50 +04:00
|
|
|
int mAttribute[2]; // Attributes that get class bonus
|
|
|
|
int mSpecialization; // 0 = Combat, 1 = Magic, 2 = Stealth
|
|
|
|
int mSkills[5][2]; // Minor and major skills.
|
|
|
|
int mIsPlayable; // 0x0001 - Playable class
|
2011-04-06 20:11:08 +04:00
|
|
|
|
|
|
|
// I have no idea how to autocalculate these items...
|
2012-09-17 11:37:50 +04:00
|
|
|
int mCalc;
|
2013-04-02 13:59:45 +02:00
|
|
|
|
|
|
|
int& getSkill (int index, bool major);
|
|
|
|
///< Throws an exception for invalid values of \a index.
|
|
|
|
|
|
|
|
int getSkill (int index, bool major) const;
|
|
|
|
///< Throws an exception for invalid values of \a index.
|
2011-04-06 20:11:08 +04:00
|
|
|
}; // 60 bytes
|
2010-02-21 17:55:12 +01:00
|
|
|
|
2012-10-07 21:24:47 +04:00
|
|
|
std::string mId, mName, mDescription;
|
2012-09-17 11:37:50 +04:00
|
|
|
CLDTstruct mData;
|
2010-02-21 17:55:12 +01:00
|
|
|
|
2015-07-20 17:23:14 +03:00
|
|
|
void load(ESMReader &esm, bool &isDeleted);
|
|
|
|
void save(ESMWriter &esm, bool isDeleted = false) const;
|
2013-03-25 13:22:06 +01:00
|
|
|
|
|
|
|
void blank();
|
|
|
|
///< Set record to default state (does not touch the ID/index).
|
|
|
|
|
2010-02-21 17:55:12 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|