1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00
OpenMW/components/esm/loaddial.hpp

59 lines
1.1 KiB
C++
Raw Normal View History

2012-09-23 22:11:08 +04:00
#ifndef OPENMW_ESM_DIAL_H
#define OPENMW_ESM_DIAL_H
2012-10-01 00:51:54 +04:00
#include <string>
2014-02-20 16:59:20 +01:00
#include <list>
#include <map>
2010-08-06 15:23:13 +02:00
#include "loadinfo.hpp"
namespace ESM
{
2012-10-01 00:51:54 +04:00
class ESMReader;
class ESMWriter;
/*
* Dialogue topic and journal entries. The actual data is contained in
* the INFO records following the DIAL.
*/
struct Dialogue
{
static unsigned int sRecordId;
enum Type
{
Topic = 0,
Voice = 1,
Greeting = 2,
Persuasion = 3,
Journal = 4,
Deleted = -1
};
std::string mId;
signed char mType;
2014-02-20 16:59:20 +01:00
typedef std::list<DialInfo> InfoContainer;
typedef std::map<std::string, InfoContainer::iterator> LookupMap;
2014-02-20 16:59:20 +01:00
InfoContainer mInfo;
// This is only used during the loading phase to speed up DialInfo merging.
LookupMap mLookup;
void load(ESMReader &esm);
void save(ESMWriter &esm) const;
2013-10-20 17:13:31 +02:00
/// Read the next info record
2014-02-20 16:59:20 +01:00
/// @param merge Merge with existing list, or just push each record to the end of the list?
void readInfo (ESM::ESMReader& esm, bool merge);
2014-02-20 16:59:20 +01:00
2013-10-20 17:13:31 +02:00
void blank();
///< Set record to default state (does not touch the ID and does not change the type).
};
}
#endif