1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 08:53:52 +00:00
openmw/components/esm3/loadclas.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.6 KiB
C++
Raw Normal View History

2012-09-23 18:11:08 +00:00
#ifndef OPENMW_ESM_CLAS_H
#define OPENMW_ESM_CLAS_H
2012-09-17 07:37:50 +00:00
#include <string>
2022-06-04 14:07:59 +00:00
#include "components/esm/defs.hpp"
namespace ESM
{
2012-09-30 20:51:54 +00:00
class ESMReader;
class ESMWriter;
/*
* Character class definitions
*/
struct Class
{
2022-06-04 14:34:23 +00:00
constexpr static RecNameInts sRecordId = REC_CLAS;
2022-09-22 18:26:05 +00:00
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Class"; }
2022-09-22 18:26:05 +00:00
enum Specialization
2022-09-22 18:26:05 +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
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
int mServices;
2022-09-22 18:26:05 +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
int getSkill(int index, bool major) const;
///< Throws an exception for invalid values of \a index.
}; // 60 bytes
2022-09-22 18:26:05 +00:00
unsigned int mRecordFlags;
std::string mId, mName, mDescription;
2012-09-17 07:37:50 +00:00
CLDTstruct mData;
2022-09-22 18:26:05 +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).
};
}
#endif