2013-11-30 13:41:12 +00:00
|
|
|
#include "journalentry.hpp"
|
|
|
|
|
|
|
|
#include "esmreader.hpp"
|
|
|
|
#include "esmwriter.hpp"
|
|
|
|
|
2022-04-11 22:18:39 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
|
|
|
|
void JournalEntry::load(ESMReader& esm)
|
2013-11-30 13:41:12 +00:00
|
|
|
{
|
|
|
|
esm.getHNOT(mType, "JETY");
|
2023-02-12 18:36:56 +00:00
|
|
|
mTopic = esm.getHNRefId("YETO");
|
|
|
|
mInfo = esm.getHNRefId("YEIN");
|
2013-11-30 13:41:12 +00:00
|
|
|
mText = esm.getHNString("TEXT");
|
|
|
|
|
2022-04-11 22:18:39 +00:00
|
|
|
if (mType == Type_Journal)
|
2013-11-30 13:41:12 +00:00
|
|
|
{
|
|
|
|
esm.getHNT(mDay, "JEDA");
|
|
|
|
esm.getHNT(mMonth, "JEMO");
|
|
|
|
esm.getHNT(mDayOfMonth, "JEDM");
|
2022-09-22 18:26:05 +00:00
|
|
|
}
|
2013-11-30 13:41:12 +00:00
|
|
|
else if (mType == Type_Topic)
|
|
|
|
mActorName = esm.getHNOString("ACT_");
|
2022-09-22 18:26:05 +00:00
|
|
|
}
|
2013-11-30 13:41:12 +00:00
|
|
|
|
|
|
|
void JournalEntry::save(ESMWriter& esm) const
|
|
|
|
{
|
|
|
|
esm.writeHNT("JETY", mType);
|
2023-02-12 18:36:56 +00:00
|
|
|
esm.writeHNRefId("YETO", mTopic);
|
|
|
|
esm.writeHNRefId("YEIN", mInfo);
|
2013-11-30 13:41:12 +00:00
|
|
|
esm.writeHNString("TEXT", mText);
|
2022-09-22 18:26:05 +00:00
|
|
|
|
2013-11-30 13:41:12 +00:00
|
|
|
if (mType == Type_Journal)
|
2022-09-22 18:26:05 +00:00
|
|
|
{
|
2013-11-30 13:41:12 +00:00
|
|
|
esm.writeHNT("JEDA", mDay);
|
|
|
|
esm.writeHNT("JEMO", mMonth);
|
|
|
|
esm.writeHNT("JEDM", mDayOfMonth);
|
2022-09-22 18:26:05 +00:00
|
|
|
}
|
2013-11-30 13:41:12 +00:00
|
|
|
else if (mType == Type_Topic)
|
2014-01-25 22:53:50 +00:00
|
|
|
esm.writeHNString("ACT_", mActorName);
|
2013-11-30 13:41:12 +00:00
|
|
|
}
|
2022-04-11 22:18:39 +00:00
|
|
|
|
|
|
|
}
|