1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-09 13:13:34 +00:00
OpenMW/components/esm3/loadbook.hpp

42 lines
993 B
C++
Raw Normal View History

2012-09-23 22:11:08 +04:00
#ifndef OPENMW_ESM_BOOK_H
#define OPENMW_ESM_BOOK_H
2022-06-04 16:07:59 +02:00
#include "components/esm/defs.hpp"
2022-09-22 21:26:05 +03:00
#include <string>
namespace ESM
{
2022-09-22 21:26:05 +03:00
/*
* Books, magic scrolls, notes and so on
*/
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
struct Book
{
constexpr static RecNameInts sRecordId = REC_BOOK;
2022-06-04 16:07:59 +02:00
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 "Book"; }
2022-09-22 21:26:05 +03:00
struct BKDTstruct
{
float mWeight;
int mValue, mIsScroll, mSkillId, mEnchant;
};
2022-09-22 21:26:05 +03:00
BKDTstruct mData;
std::string mName, mModel, mIcon, mScript, mEnchant, mText;
unsigned int mRecordFlags;
std::string mId;
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
void blank();
///< Set record to default state (does not touch the ID).
};
}
#endif