1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 19:15:41 +00:00
openmw/components/esm3/spelllist.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
747 B
C++
Raw Normal View History

2012-09-17 07:37:50 +00:00
#include "spelllist.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
2012-09-17 07:37:50 +00:00
#include <components/misc/strings/algorithm.hpp>
namespace ESM
{
2012-09-17 07:37:50 +00:00
void SpellList::add(ESMReader& esm)
{
mList.push_back(esm.getHString());
}
void SpellList::save(ESMWriter& esm) const
2012-09-17 07:37:50 +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);
2022-09-22 18:26:05 +00:00
}
2012-09-17 07:37:50 +00:00
}
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
}