2015-06-26 11:01:25 +00:00
|
|
|
#include "metadata.hpp"
|
|
|
|
|
2022-01-22 14:58:41 +00:00
|
|
|
#include <components/esm3/esmreader.hpp>
|
|
|
|
#include <components/esm3/esmwriter.hpp>
|
|
|
|
#include <components/esm3/loadtes3.hpp>
|
2015-06-26 11:01:25 +00:00
|
|
|
|
|
|
|
void CSMWorld::MetaData::blank()
|
|
|
|
{
|
2022-05-20 19:47:13 +00:00
|
|
|
// ESM::Header::CurrentFormat is `1` but since new records are not yet used in opencs
|
|
|
|
// we use the format `0` for compatibility with old versions.
|
|
|
|
mFormat = 0;
|
2015-06-26 11:01:25 +00:00
|
|
|
mAuthor.clear();
|
|
|
|
mDescription.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CSMWorld::MetaData::load(ESM::ESMReader& esm)
|
|
|
|
{
|
|
|
|
mFormat = esm.getHeader().mFormat;
|
2018-09-25 13:16:40 +00:00
|
|
|
mAuthor = esm.getHeader().mData.author;
|
|
|
|
mDescription = esm.getHeader().mData.desc;
|
2015-06-26 11:01:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSMWorld::MetaData::save(ESM::ESMWriter& esm) const
|
|
|
|
{
|
|
|
|
esm.setFormat(mFormat);
|
|
|
|
esm.setAuthor(mAuthor);
|
|
|
|
esm.setDescription(mDescription);
|
|
|
|
}
|