mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
634 B
C++
28 lines
634 B
C++
11 years ago
|
#include "locals.hpp"
|
||
|
|
||
|
#include "esmreader.hpp"
|
||
|
#include "esmwriter.hpp"
|
||
|
|
||
|
void ESM::Locals::load (ESMReader &esm)
|
||
|
{
|
||
|
while (esm.isNextSub ("LOCA"))
|
||
|
{
|
||
|
std::string id = esm.getHString();
|
||
|
|
||
|
Variant value;
|
||
10 years ago
|
value.read (esm, Variant::Format_Local);
|
||
11 years ago
|
|
||
4 years ago
|
mVariables.emplace_back (id, value);
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
void ESM::Locals::save (ESMWriter &esm) const
|
||
|
{
|
||
|
for (std::vector<std::pair<std::string, Variant> >::const_iterator iter (mVariables.begin());
|
||
|
iter!=mVariables.end(); ++iter)
|
||
|
{
|
||
|
esm.writeHNString ("LOCA", iter->first);
|
||
10 years ago
|
iter->second.write (esm, Variant::Format_Local);
|
||
11 years ago
|
}
|
||
10 years ago
|
}
|