store list of known topics in saved game files
parent
6ac64bbe15
commit
9f721fd144
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
#include "dialoguestate.hpp"
|
||||||
|
|
||||||
|
#include "esmreader.hpp"
|
||||||
|
#include "esmwriter.hpp"
|
||||||
|
|
||||||
|
void ESM::DialogueState::load (ESMReader &esm)
|
||||||
|
{
|
||||||
|
while (esm.isNextSub ("TOPI"))
|
||||||
|
mKnownTopics.push_back (esm.getHString());
|
||||||
|
}
|
||||||
|
|
||||||
|
void ESM::DialogueState::save (ESMWriter &esm) const
|
||||||
|
{
|
||||||
|
for (std::vector<std::string>::const_iterator iter (mKnownTopics.begin());
|
||||||
|
iter!=mKnownTopics.end(); ++iter)
|
||||||
|
{
|
||||||
|
esm.writeHNString ("TOPI", *iter);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef OPENMW_ESM_DIALOGUESTATE_H
|
||||||
|
#define OPENMW_ESM_DIALOGUESTATE_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace ESM
|
||||||
|
{
|
||||||
|
class ESMReader;
|
||||||
|
class ESMWriter;
|
||||||
|
|
||||||
|
// format 0, saved games only
|
||||||
|
|
||||||
|
struct DialogueState
|
||||||
|
{
|
||||||
|
std::vector<std::string> mKnownTopics;
|
||||||
|
|
||||||
|
void load (ESMReader &esm);
|
||||||
|
void save (ESMWriter &esm) const;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue