1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 00:39:58 +00:00
OpenMW/components/esm3/loadench.hpp

60 lines
1.2 KiB
C++
Raw Normal View History

2012-09-23 22:11:08 +04:00
#ifndef OPENMW_ESM_ENCH_H
#define OPENMW_ESM_ENCH_H
#include <string>
2022-06-04 16:07:59 +02:00
#include "components/esm/defs.hpp"
2012-09-17 11:37:50 +04:00
#include "effectlist.hpp"
namespace ESM
{
2012-10-01 00:51:54 +04:00
2022-09-22 21:26:05 +03:00
class ESMReader;
class ESMWriter;
2012-10-01 00:51:54 +04:00
2022-09-22 21:26:05 +03:00
/*
* Enchantments
*/
2022-09-22 21:26:05 +03:00
struct Enchantment
{
2022-09-22 21:26:05 +03:00
constexpr static RecNameInts sRecordId = REC_ENCH;
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Enchantment"; }
enum Type
{
CastOnce = 0,
WhenStrikes = 1,
WhenUsed = 2,
ConstantEffect = 3
};
enum Flags
{
Autocalc = 0x01
};
struct ENDTstruct
{
int mType;
int mCost;
int mCharge;
int mFlags;
};
unsigned int mRecordFlags;
std::string mId;
ENDTstruct mData;
EffectList mEffects;
void load(ESMReader& esm, bool& isDeleted);
void save(ESMWriter& esm, bool isDeleted = false) const;
void blank();
///< Set record to default state (does not touch the ID).
};
}
#endif