1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 05:49:56 +00:00
openmw-tes3mp/components/esm/loadlocks.hpp
2012-09-23 22:11:08 +04:00

63 lines
1.1 KiB
C++

#ifndef OPENMW_ESM_LOCKS_H
#define OPENMW_ESM_LOCKS_H
#include "record.hpp"
namespace ESM
{
/*
* This file covers lockpicks (LOCK), probes (PROB) and armor repair
* items (REPA). These have nearly identical data structures.
*/
struct Tool : public Record
{
enum Type
{
Type_Pick,
Type_Probe,
Type_Repair
};
struct Data
{
float mWeight;
int mValue;
float mQuality; // And when I say nearly identical structure, I
int mUses; // mean perfectly identical except that these two
// variables are swaped for repair items. Don't ask
// me why.
}; // Size = 16
Data mData;
Type mType;
std::string mName, mModel, mIcon, mScript;
void load(ESMReader &esm);
void save(ESMWriter &esm);
int getName()
{
if (mType == Type_Probe)
return REC_PROB;
else if (mType == Type_Repair)
return REC_REPA;
else
return REC_LOCK;
}
};
struct Probe: Tool
{
Probe() { mType = Type_Probe; }
};
struct Repair: Tool
{
Repair() { mType = Type_Repair; }
};
}
#endif