1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00
OpenMW/components/esm3/spelllist.cpp
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2022-08-03 22:06:24 +02:00

32 lines
671 B
C++

#include "spelllist.hpp"
#include "esmreader.hpp"
#include "esmwriter.hpp"
#include <components/misc/strings/algorithm.hpp>
namespace ESM
{
void SpellList::add(ESMReader &esm)
{
mList.push_back(esm.getHString());
}
void SpellList::save(ESMWriter &esm) const
{
for (std::vector<std::string>::const_iterator it = mList.begin(); it != mList.end(); ++it) {
esm.writeHNString("NPCS", *it, 32);
}
}
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;
}
}