2011-04-06 16:11:08 +00:00
|
|
|
#include "loadarmo.hpp"
|
|
|
|
|
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
|
|
|
|
void PartReferenceList::load(ESMReader &esm)
|
|
|
|
{
|
|
|
|
while (esm.isNextSub("INDX"))
|
|
|
|
{
|
|
|
|
PartReference pr;
|
|
|
|
esm.getHT(pr.part); // The INDX byte
|
|
|
|
pr.male = esm.getHNOString("BNAM");
|
|
|
|
pr.female = esm.getHNOString("CNAM");
|
2012-04-06 19:04:30 +00:00
|
|
|
parts.push_back(pr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void PartReferenceList::save(ESMWriter &esm)
|
|
|
|
{
|
|
|
|
for (std::vector<PartReference>::iterator it = parts.begin(); it != parts.end(); ++it)
|
|
|
|
{
|
2012-04-08 15:04:52 +00:00
|
|
|
esm.writeHNT("INDX", it->part);
|
2012-04-06 19:14:52 +00:00
|
|
|
esm.writeHNOString("BNAM", it->male);
|
|
|
|
esm.writeHNOString("CNAM", it->female);
|
2011-04-06 16:11:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Armor::load(ESMReader &esm)
|
|
|
|
{
|
|
|
|
model = esm.getHNString("MODL");
|
|
|
|
name = esm.getHNString("FNAM");
|
|
|
|
script = esm.getHNOString("SCRI");
|
|
|
|
esm.getHNT(data, "AODT", 24);
|
|
|
|
icon = esm.getHNOString("ITEX");
|
|
|
|
parts.load(esm);
|
|
|
|
enchant = esm.getHNOString("ENAM");
|
|
|
|
}
|
|
|
|
|
2012-04-06 19:04:30 +00:00
|
|
|
void Armor::save(ESMWriter &esm)
|
|
|
|
{
|
|
|
|
esm.writeHNString("MODL", model);
|
|
|
|
esm.writeHNString("FNAM", name);
|
2012-04-06 19:14:52 +00:00
|
|
|
esm.writeHNOString("SCRI", script);
|
2012-04-06 19:04:30 +00:00
|
|
|
esm.writeHNT("AODT", data, 24);
|
2012-04-06 19:14:52 +00:00
|
|
|
esm.writeHNOString("ITEX", icon);
|
2012-04-06 19:04:30 +00:00
|
|
|
parts.save(esm);
|
2012-04-06 19:14:52 +00:00
|
|
|
esm.writeHNOString("ENAM", enchant);
|
2012-04-06 19:04:30 +00:00
|
|
|
}
|
|
|
|
|
2011-04-06 16:11:08 +00:00
|
|
|
}
|