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

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

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
class ESMReader;
class ESMWriter;
/*
* Enchantments
*/
struct Enchantment
{
2022-06-04 16:34:23 +02:00
constexpr static RecNameInts sRecordId = REC_ENCH;
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 "Enchantment"; }
2022-09-22 21:26:05 +03:00
enum Type
2022-09-22 21:26:05 +03:00
{
CastOnce = 0,
WhenStrikes = 1,
WhenUsed = 2,
ConstantEffect = 3
2022-09-22 21:26:05 +03:00
};
enum Flags
2022-09-22 21:26:05 +03:00
{
Autocalc = 0x01
2022-09-22 21:26:05 +03:00
};
struct ENDTstruct
2022-09-22 21:26:05 +03:00
{
2012-09-17 11:37:50 +04:00
int mType;
int mCost;
int mCharge;
int mFlags;
2022-09-22 21:26:05 +03:00
};
unsigned int mRecordFlags;
std::string mId;
2012-09-17 11:37:50 +04:00
ENDTstruct mData;
EffectList mEffects;
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
2014-06-30 20:40:34 +02:00
void blank();
///< Set record to default state (does not touch the ID).
};
}
#endif