1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-30 03:32:36 +00:00
OpenMW/components/esm3/loadmisc.hpp

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

51 lines
1.2 KiB
C++
Raw Normal View History

2012-09-23 22:11:08 +04:00
#ifndef OPENMW_ESM_MISC_H
#define OPENMW_ESM_MISC_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;
/*
* Misc inventory items, basically things that have no use but can be
* carried, bought and sold. It also includes keys.
*/
struct Miscellaneous
{
2022-06-04 16:34:23 +02:00
constexpr static RecNameInts sRecordId = REC_MISC;
2022-06-04 16:07:59 +02:00
/// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Miscellaneous"; }
struct MCDTstruct
{
2012-09-17 11:37:50 +04:00
float mWeight;
int mValue;
2022-09-30 12:16:45 +02:00
int mFlags;
};
2022-09-30 12:16:45 +02:00
enum Flags
{
Key = 0x1 // Assigned as a key in the content file that defined the record
};
2012-09-17 11:37:50 +04:00
MCDTstruct mData;
unsigned int mRecordFlags;
std::string mId, mName, mModel, mIcon, mScript;
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