2012-09-23 18:11:08 +00:00
|
|
|
#ifndef OPENMW_ESM_LOCKS_H
|
|
|
|
#define OPENMW_ESM_LOCKS_H
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2012-04-08 09:51:52 +00:00
|
|
|
#include "record.hpp"
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2010-02-21 16:55:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This file covers lockpicks (LOCK), probes (PROB) and armor repair
|
|
|
|
* items (REPA). These have nearly identical data structures.
|
|
|
|
*/
|
|
|
|
|
2012-04-08 09:51:52 +00:00
|
|
|
struct Tool : public Record
|
2010-02-21 16:55:12 +00:00
|
|
|
{
|
2012-04-06 19:04:30 +00:00
|
|
|
enum Type
|
|
|
|
{
|
|
|
|
Type_Pick,
|
|
|
|
Type_Probe,
|
|
|
|
Type_Repair
|
|
|
|
};
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
struct Data
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
float mWeight;
|
|
|
|
int mValue;
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
float mQuality; // And when I say nearly identical structure, I
|
|
|
|
int mUses; // mean perfectly identical except that these two
|
2011-04-08 13:58:21 +00:00
|
|
|
// variables are swaped for repair items. Don't ask
|
|
|
|
// me why.
|
|
|
|
}; // Size = 16
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
Data mData;
|
|
|
|
Type mType;
|
|
|
|
std::string mName, mModel, mIcon, mScript;
|
2010-02-21 16:55:12 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
void load(ESMReader &esm);
|
2012-04-06 19:04:30 +00:00
|
|
|
void save(ESMWriter &esm);
|
2012-04-08 09:51:52 +00:00
|
|
|
|
|
|
|
int getName()
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
if (mType == Type_Probe)
|
2012-04-08 09:51:52 +00:00
|
|
|
return REC_PROB;
|
2012-09-17 07:37:50 +00:00
|
|
|
else if (mType == Type_Repair)
|
2012-04-08 09:51:52 +00:00
|
|
|
return REC_REPA;
|
|
|
|
else
|
|
|
|
return REC_LOCK;
|
|
|
|
}
|
2010-02-21 16:55:12 +00:00
|
|
|
};
|
2010-08-03 13:24:44 +00:00
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
struct Probe: Tool
|
2010-08-03 13:24:44 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
Probe() { mType = Type_Probe; }
|
2010-08-03 13:24:44 +00:00
|
|
|
};
|
|
|
|
|
2011-04-08 13:58:21 +00:00
|
|
|
struct Repair: Tool
|
2010-08-03 13:24:44 +00:00
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
Repair() { mType = Type_Repair; }
|
2010-08-03 13:24:44 +00:00
|
|
|
};
|
|
|
|
|
2010-02-21 16:55:12 +00:00
|
|
|
}
|
|
|
|
#endif
|