1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-15 22:49:48 +00:00
OpenMW/components/esm/attr.hpp

48 lines
1.2 KiB
C++
Raw Normal View History

2012-09-23 18:11:08 +00:00
#ifndef OPENMW_ESM_ATTR_H
#define OPENMW_ESM_ATTR_H
#include <string>
2023-08-03 18:21:44 +00:00
#include <string_view>
#include "defs.hpp"
#include "refid.hpp"
2022-09-22 18:26:05 +00:00
namespace ESM
{
2023-08-03 18:21:44 +00:00
class ESMReader;
class ESMWriter;
2022-09-22 18:26:05 +00:00
/*
* Attribute definitions
*/
2022-09-22 18:26:05 +00:00
struct Attribute
{
2023-08-03 18:21:44 +00:00
constexpr static RecNameInts sRecordId = REC_ATTR;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Attribute"; }
using AttributeID = StringRefId;
static const AttributeID Strength;
static const AttributeID Intelligence;
static const AttributeID Willpower;
static const AttributeID Agility;
static const AttributeID Speed;
static const AttributeID Endurance;
static const AttributeID Personality;
static const AttributeID Luck;
static constexpr int Length = 8;
2022-09-22 18:26:05 +00:00
AttributeID mId;
2023-05-31 15:02:18 +00:00
std::string mName, mDescription, mIcon;
float mWerewolfValue{};
2023-08-03 18:21:44 +00:00
void load(ESMReader& esm, bool& isDeleted);
void save(ESMWriter& esm, bool isDeleted = false) const;
2023-08-03 18:21:44 +00:00
static RefId indexToRefId(int index);
static int refIdToIndex(RefId id);
2022-09-22 18:26:05 +00:00
};
}
#endif