2011-04-06 16:11:08 +00:00
|
|
|
#include "loadbook.hpp"
|
|
|
|
|
2012-09-23 18:41:41 +00:00
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
|
2011-04-06 16:11:08 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
|
|
|
|
void Book::load(ESMReader &esm)
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
mModel = esm.getHNString("MODL");
|
|
|
|
mName = esm.getHNOString("FNAM");
|
|
|
|
esm.getHNT(mData, "BKDT", 20);
|
|
|
|
mScript = esm.getHNOString("SCRI");
|
|
|
|
mIcon = esm.getHNOString("ITEX");
|
|
|
|
mText = esm.getHNOString("TEXT");
|
|
|
|
mEnchant = esm.getHNOString("ENAM");
|
2011-04-06 16:11:08 +00:00
|
|
|
}
|
2012-04-06 19:04:30 +00:00
|
|
|
void Book::save(ESMWriter &esm)
|
|
|
|
{
|
2012-09-17 07:37:50 +00:00
|
|
|
esm.writeHNCString("MODL", mModel);
|
|
|
|
esm.writeHNOCString("FNAM", mName);
|
|
|
|
esm.writeHNT("BKDT", mData, 20);
|
|
|
|
esm.writeHNOCString("SCRI", mScript);
|
|
|
|
esm.writeHNOCString("ITEX", mIcon);
|
|
|
|
esm.writeHNOString("TEXT", mText);
|
|
|
|
esm.writeHNOCString("ENAM", mEnchant);
|
2011-04-06 16:11:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|