1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 00:39:58 +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 22:11:08 +04:00
#ifndef OPENMW_ESM_CLAS_H
#define OPENMW_ESM_CLAS_H
2012-09-17 11:37:50 +04:00
#include <string>
2022-06-04 16:07:59 +02:00
#include "components/esm/defs.hpp"
namespace ESM
{
2012-10-01 00:51:54 +04:00
class ESMReader;
class ESMWriter;
/*
* Character class definitions
*/
struct Class
{
2022-06-04 16:34:23 +02:00
constexpr static RecNameInts sRecordId = REC_CLAS;
2022-09-22 21:26:05 +03: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 21:26:05 +03:00
enum Specialization
2022-09-22 21:26:05 +03:00
{
Combat = 0,
Magic = 1,
Stealth = 2
2022-09-22 21:26:05 +03:00
};
2012-09-17 11:37:50 +04:00
static const Specialization sSpecializationIds[3];
static const char* sGmstSpecializationIds[3];
2022-09-22 21:26:05 +03:00
struct CLDTstruct
2022-09-22 21:26:05 +03: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
int mServices;
2022-09-22 21:26:05 +03:00
int& getSkill(int index, bool major);
///< Throws an exception for invalid values of \a index.
2022-09-22 21:26:05 +03:00
int getSkill(int index, bool major) const;
///< Throws an exception for invalid values of \a index.
}; // 60 bytes
2022-09-22 21:26:05 +03:00
unsigned int mRecordFlags;
std::string mId, mName, mDescription;
2012-09-17 11:37:50 +04:00
CLDTstruct mData;
2022-09-22 21:26:05 +03:00
void load(ESMReader& esm, bool& isDeleted);
void save(ESMWriter& esm, bool isDeleted = false) const;
2022-09-22 21:26:05 +03:00
2013-03-25 13:22:06 +01:00
void blank();
///< Set record to default state (does not touch the ID/index).
};
}
#endif