2012-09-17 07:37:50 +00:00
|
|
|
#include "spelllist.hpp"
|
|
|
|
|
2012-09-23 18:41:41 +00:00
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
2012-09-17 07:37:50 +00:00
|
|
|
|
|
|
|
namespace ESM {
|
|
|
|
|
2015-02-10 22:16:25 +00:00
|
|
|
void SpellList::add(ESMReader &esm)
|
|
|
|
{
|
|
|
|
mList.push_back(esm.getHString());
|
|
|
|
}
|
|
|
|
|
2013-09-16 10:32:35 +00:00
|
|
|
void SpellList::save(ESMWriter &esm) const
|
2012-09-17 07:37:50 +00:00
|
|
|
{
|
2013-09-16 10:32:35 +00:00
|
|
|
for (std::vector<std::string>::const_iterator it = mList.begin(); it != mList.end(); ++it) {
|
2012-09-17 07:37:50 +00:00
|
|
|
esm.writeHNString("NPCS", *it, 32);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-02 12:45:57 +00:00
|
|
|
bool SpellList::exists(const std::string &spell) const
|
|
|
|
{
|
|
|
|
for (std::vector<std::string>::const_iterator it = mList.begin(); it != mList.end(); ++it)
|
|
|
|
if (Misc::StringUtils::ciEqual(*it, spell))
|
|
|
|
return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-09-17 07:37:50 +00:00
|
|
|
}
|