2012-09-23 18:11:08 +00:00
|
|
|
#ifndef OPENMW_ESM_CLAS_H
|
|
|
|
#define OPENMW_ESM_CLAS_H
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
#include <string>
|
|
|
|
|
2022-06-04 14:07:59 +00:00
|
|
|
#include "components/esm/defs.hpp"
|
|
|
|
|
2011-04-06 16:11:08 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2012-09-30 20:51:54 +00:00
|
|
|
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
|
2010-02-21 16:55:12 +00:00
|
|
|
/*
|
|
|
|
* Character class definitions
|
|
|
|
*/
|
2011-04-06 16:11:08 +00:00
|
|
|
struct Class
|
2010-09-19 02:29:22 +00:00
|
|
|
{
|
2022-06-04 14:34:23 +00:00
|
|
|
constexpr static RecNameInts sRecordId = REC_CLAS;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2015-06-14 00:31:00 +00:00
|
|
|
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
|
2021-10-11 22:18:23 +00:00
|
|
|
static std::string_view getRecordType() { return "Class"; }
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2011-04-06 16:11:08 +00:00
|
|
|
enum Specialization
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2011-04-08 18:26:27 +00:00
|
|
|
Combat = 0,
|
|
|
|
Magic = 1,
|
|
|
|
Stealth = 2
|
2022-09-22 18:26:05 +00:00
|
|
|
};
|
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
static const Specialization sSpecializationIds[3];
|
|
|
|
static const char* sGmstSpecializationIds[3];
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2011-04-06 16:11:08 +00:00
|
|
|
struct CLDTstruct
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00: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
|
2022-10-08 15:00:33 +00:00
|
|
|
int mServices;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2013-04-02 11:59:45 +00:00
|
|
|
int& getSkill(int index, bool major);
|
|
|
|
///< Throws an exception for invalid values of \a index.
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2013-04-02 11:59:45 +00:00
|
|
|
int getSkill(int index, bool major) const;
|
|
|
|
///< Throws an exception for invalid values of \a index.
|
2011-04-06 16:11:08 +00:00
|
|
|
}; // 60 bytes
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2021-07-25 09:53:41 +00:00
|
|
|
unsigned int mRecordFlags;
|
2012-10-07 17:24:47 +00:00
|
|
|
std::string mId, mName, mDescription;
|
2012-09-17 07:37:50 +00:00
|
|
|
CLDTstruct mData;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2015-07-20 14:23:14 +00:00
|
|
|
void load(ESMReader& esm, bool& isDeleted);
|
|
|
|
void save(ESMWriter& esm, bool isDeleted = false) const;
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2013-03-25 12:22:06 +00:00
|
|
|
void blank();
|
|
|
|
///< Set record to default state (does not touch the ID/index).
|
2010-09-19 02:29:22 +00:00
|
|
|
};
|
2010-02-21 16:55:12 +00:00
|
|
|
}
|
|
|
|
#endif
|