mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-19 17:09:40 +00:00
This commit is contained in:
parent
f717fe0254
commit
b93eb84401
3 changed files with 33 additions and 16 deletions
|
@ -37,14 +37,14 @@ public:
|
|||
*************************************************************************/
|
||||
|
||||
int getVer() const { return mCtx.header.version; }
|
||||
float getFVer() { if(mCtx.header.version == VER_12) return 1.2; else return 1.3; }
|
||||
int getSpecial() { return mSpf; }
|
||||
int getType() { return mCtx.header.type; }
|
||||
const std::string getAuthor() { return mCtx.header.author.toString(); }
|
||||
const std::string getDesc() { return mCtx.header.desc.toString(); }
|
||||
float getFVer() const { if(mCtx.header.version == VER_12) return 1.2; else return 1.3; }
|
||||
int getSpecial() const { return mSpf; }
|
||||
int getType() const { return mCtx.header.type; }
|
||||
const std::string getAuthor() const { return mCtx.header.author.toString(); }
|
||||
const std::string getDesc() const { return mCtx.header.desc.toString(); }
|
||||
const SaveData &getSaveData() const { return mSaveData; }
|
||||
const MasterList &getMasters() { return mMasters; }
|
||||
const NAME &retSubName() { return mCtx.subName; }
|
||||
const MasterList &getMasters() const { return mMasters; }
|
||||
const NAME &retSubName() const { return mCtx.subName; }
|
||||
uint32_t getSubSize() const { return mCtx.leftSub; }
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -85,7 +85,7 @@ public:
|
|||
int mIdx;
|
||||
void setIndex(const int index) {mIdx = index; mCtx.index = index;}
|
||||
const int getIndex() {return mIdx;}
|
||||
|
||||
|
||||
void setGlobalReaderList(std::vector<ESMReader> *list) {mGlobalReaderList = list;}
|
||||
std::vector<ESMReader> *getGlobalReaderList() {return mGlobalReaderList;}
|
||||
|
||||
|
|
|
@ -7,13 +7,28 @@ namespace ESM
|
|||
{
|
||||
void Apparatus::load(ESMReader &esm)
|
||||
{
|
||||
mModel = esm.getHNString("MODL");
|
||||
mName = esm.getHNString("FNAM");
|
||||
esm.getHNT(mData, "AADT", 16);
|
||||
mScript = esm.getHNOString("SCRI");
|
||||
mIcon = esm.getHNString("ITEX");
|
||||
// we will not treat duplicated subrecords as errors here
|
||||
while (esm.hasMoreSubs())
|
||||
{
|
||||
esm.getSubName();
|
||||
NAME subName = esm.retSubName();
|
||||
|
||||
if (subName == "MODL")
|
||||
mModel = esm.getHString();
|
||||
else if (subName == "FNAM")
|
||||
mName = esm.getHString();
|
||||
else if (subName == "AADT")
|
||||
esm.getHT(mData);
|
||||
else if (subName == "SCRI")
|
||||
mScript = esm.getHString();
|
||||
else if (subName == "ITEX")
|
||||
mIcon = esm.getHString();
|
||||
else
|
||||
esm.fail("wrong subrecord type " + subName.toString() + " for APPA record");
|
||||
}
|
||||
}
|
||||
void Apparatus::save(ESMWriter &esm)
|
||||
|
||||
void Apparatus::save(ESMWriter &esm) const
|
||||
{
|
||||
esm.writeHNCString("MODL", mModel);
|
||||
esm.writeHNCString("FNAM", mName);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef OPENMW_ESM_APPA_H
|
||||
#define OPENMW_ESM_APPA_H
|
||||
|
||||
#include "esmcommon.hpp"
|
||||
#include <string>
|
||||
|
||||
namespace ESM
|
||||
|
@ -13,8 +14,9 @@ class ESMWriter;
|
|||
* Alchemist apparatus
|
||||
*/
|
||||
|
||||
struct Apparatus
|
||||
class Apparatus
|
||||
{
|
||||
public:
|
||||
enum AppaType
|
||||
{
|
||||
MortarPestle = 0,
|
||||
|
@ -35,7 +37,7 @@ struct Apparatus
|
|||
std::string mId, mModel, mIcon, mScript, mName;
|
||||
|
||||
void load(ESMReader &esm);
|
||||
void save(ESMWriter &esm);
|
||||
void save(ESMWriter &esm) const;
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue