1 #ifndef OPENMW_ESSIMPORT_CONVERTER_H
2 #define OPENMW_ESSIMPORT_CONVERTER_H
84 bool isDeleted =
false;
86 record.load(esm, isDeleted);
92 for (
typename std::map<std::string, T>::const_iterator it =
mRecords.begin(); it !=
mRecords.end(); ++it)
110 bool isDeleted =
false;
112 npc.
load(esm, isDeleted);
113 if (npc.
mId !=
"player")
148 bool isDeleted =
false;
150 creature.
load(esm, isDeleted);
165 bool isDeleted =
false;
167 global.
load(esm, isDeleted);
186 bool isDeleted =
false;
188 class_.
load(esm, isDeleted);
189 if (class_.
mId ==
"NEWCLASSID_CHARGEN")
202 bool isDeleted =
false;
204 book.
load(esm, isDeleted);
220 if (
id ==
"PlayerSaveGame")
239 assert(refr.
mRefID ==
"PlayerSaveGame");
253 for (
unsigned int i=0; i<invState.
mItems.size(); ++i)
392 bool isDeleted =
false;
394 faction.
load(esm, isDeleted);
397 for (std::map<std::string, int>::const_iterator it = faction.
mReactions.begin(); it != faction.
mReactions.end(); ++it)
431 for (std::map<std::string, std::set<Owner> >::const_iterator it =
mStolenItems.begin(); it !=
mStolenItems.end(); ++it)
433 std::map<std::pair<std::string, bool>,
int> owners;
434 for (std::set<Owner>::const_iterator ownerIt = it->second.begin(); ownerIt != it->second.end(); ++ownerIt)
436 owners.insert(std::make_pair(std::make_pair(ownerIt->first, ownerIt->second)
441 ,std::numeric_limits<int>::max()));
444 items.
mStolenItems.insert(std::make_pair(it->first, owners));
453 typedef std::pair<std::string, bool>
Owner;
487 for (std::map<std::string, DIAL>::const_iterator it =
mDials.begin(); it !=
mDials.end(); ++it)
492 state.
mState = it->second.mIndex;
536 if(weatherID >= -1 && weatherID < 10)
542 std::stringstream error;
543 error <<
"Invalid weather ID:" << weatherID << std::endl;
544 throw std::runtime_error(error.str());
585 for (std::vector<ESM::GlobalScript>::const_iterator it =
mScripts.begin(); it !=
mScripts.end(); ++it)
bool mLevitationEnabled
Definition: converter.hpp:301
Definition: converter.hpp:513
void load(ESMReader &esm, bool &isDeleted)
Definition: loadbook.cpp:11
virtual void write(ESM::ESMWriter &esm)
Definition: converter.cpp:400
std::string mName
Definition: loadclas.hpp:73
std::map< std::string, int > mKillCounter
RefId, kill count.
Definition: importklst.hpp:21
static bool ciEqual(const std::string &x, const std::string &y)
Definition: stringops.hpp:62
int mMonth
Definition: importercontext.hpp:43
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:583
std::string getHNString(const char *name)
Definition: esmreader.cpp:108
Definition: stolenitems.hpp:13
std::string mSelectedSpell
Definition: converter.hpp:268
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:261
void writeHNT(const std::string &name, const T &data)
Definition: esmwriter.hpp:78
void load(ESM::ESMReader &esm)
Definition: importinfo.cpp:8
GAME mGame
Definition: converter.hpp:568
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:409
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:548
std::map< std::string, std::set< Owner > > mStolenItems
Definition: converter.hpp:455
float mTimeOfNextTransition
Definition: importgame.hpp:22
std::string mId
Definition: loadcrea.hpp:88
void load(ESM::ESMReader &esm)
Definition: importklst.cpp:8
std::vector< ESM::GlobalScript > mScripts
Definition: converter.hpp:593
std::string mTopic
Definition: queststate.hpp:15
virtual int getStage()
Definition: converter.hpp:51
std::map< std::string, T > mRecords
Definition: converter.hpp:101
Definition: converter.hpp:315
int mIndex
Definition: importcntc.hpp:17
std::vector< ObjectState > mItems
Definition: inventorystate.hpp:18
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:107
void load(ESM::ESMReader &esm)
Definition: importgame.cpp:8
Definition: converter.hpp:474
Context * mContext
Definition: converter.hpp:71
std::string mRefID
Definition: importplayer.hpp:26
Definition: esmreader.hpp:21
std::map< std::pair< int, int >, Cell > mExtCells
Definition: converter.hpp:352
void startRecord(const std::string &name, uint32_t flags=0)
Definition: esmwriter.cpp:89
Definition: queststate.hpp:13
Definition: importques.hpp:18
void load(ESMReader &esm, bool &isDeleted)
Definition: loadglob.cpp:11
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:485
int mNextWeather
Definition: importgame.hpp:20
int mLevel
Definition: creaturestats.hpp:63
ConvertGAME()
Definition: converter.hpp:526
CreatureStats mCreatureStats
Definition: npcstate.hpp:17
Definition: converter.hpp:327
void load(ESM::ESMReader &esm)
Definition: importplayer.cpp:19
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:389
int mNextWeather
Definition: weatherstate.hpp:27
void convertACDT(const ACDT &acdt, ESM::CreatureStats &cStats)
Definition: convertacdt.cpp:21
static std::string lowerCase(const std::string &in)
Returns lower case copy of input string.
Definition: stringops.hpp:103
Definition: importercontext.hpp:25
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:306
Definition: converter.hpp:271
std::map< std::pair< int, std::string >, CREC > mCreatureChanges
Definition: importercontext.hpp:47
Storage structure for global script state (only used in saved games)
Definition: globalscript.hpp:13
Definition: converter.hpp:523
std::map< std::string, int > mKillCounter
Definition: converter.hpp:383
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:318
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:199
int mDay
Definition: importercontext.hpp:43
std::vector< CellRef > mRefs
Definition: converter.hpp:347
ESM::NPC mPlayerBase
Definition: importercontext.hpp:31
void writeHNString(const std::string &name, const std::string &data)
Definition: esmwriter.cpp:158
NpcStats mNpcStats
Definition: npcstate.hpp:16
std::string mId
Definition: loadbook.hpp:29
Definition: loadcrea.hpp:22
Definition: converter.hpp:196
struct ESSImport::NPCC::NPDT mNPDT
void load(ESMReader &esm, bool &isDeleted)
Definition: loadclas.cpp:41
NpcState mObject
Definition: player.hpp:22
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:428
int mWerewolfKills
Definition: npcstats.hpp:37
void load(ESMReader &esm, bool &isDeleted)
Definition: loadfact.cpp:29
int mIndex
Definition: importdial.hpp:13
Definition: loadglob.hpp:18
Definition: importnpcc.hpp:18
std::string mSelectedSpell
Definition: importacdt.hpp:81
ActorData mActorData
Definition: importplayer.hpp:24
SpellList mSpells
Definition: loadnpc.hpp:117
ConvertPCDT()
Definition: converter.hpp:274
InventoryList mInventory
Definition: loadnpc.hpp:116
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:144
BKDTstruct mData
Definition: loadbook.hpp:27
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:287
void write(ESM::ESMWriter &esm) const
Definition: stolenitems.cpp:9
std::vector< std::string > mKnownTopics
Definition: dialoguestate.hpp:18
bool mHasGame
Definition: converter.hpp:567
Definition: importscpt.hpp:17
Journal.
Definition: importjour.hpp:15
Variant mValue
Definition: loadglob.hpp:25
int mState
Definition: queststate.hpp:16
Definition: converter.hpp:47
void save(ESMWriter &esm) const
Definition: queststate.cpp:13
Definition: converter.hpp:386
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:215
std::string mId
Definition: loadfact.hpp:36
void load(ESM::ESMReader &esm)
Definition: importnpcc.cpp:8
std::map< std::string, ESM::NPC > mNpcs
Definition: importercontext.hpp:52
Kill Stats.
Definition: importklst.hpp:16
Definition: esmwriter.hpp:17
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:371
virtual void write(ESM::ESMWriter &esm)
Definition: converter.cpp:87
Definition: converter.hpp:159
std::vector< ContItem > mList
Definition: loadcont.hpp:28
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:183
Definition: creaturestats.hpp:23
std::string mId
Definition: loadclas.hpp:73
void save(ESMWriter &esm) const
Definition: weatherstate.cpp:50
void convertPCDT(const PCDT &pcdt, ESM::Player &out, std::vector< std::string > &outDialogueTopics, bool &firstPersonCam, bool &teleportingEnabled, bool &levitationEnabled, ESM::ControlsState &controls)
Definition: convertplayer.cpp:8
int mWerewolfKills
Definition: importklst.hpp:23
virtual ~Converter()
Definition: converter.hpp:53
void load(ESMReader &esm, bool &isDeleted)
Definition: loadnpc.cpp:11
Definition: converter.hpp:359
int mSkillID
Definition: loadbook.hpp:24
bool mFastForward
Definition: weatherstate.hpp:23
Definition: converter.hpp:304
int mWeatherTransition
Definition: importgame.hpp:21
Definition: loadnpc.hpp:23
void setContext(Context &context)
Definition: converter.hpp:55
std::string mSelectedEnchantItem
Definition: importacdt.hpp:82
ESM::Position mPosition
Definition: objectstate.hpp:27
virtual int getStage()
Definition: converter.hpp:79
void load(ESM::ESMReader &esm)
Definition: importcntc.cpp:8
std::string mId
Definition: loadnpc.hpp:128
SpellState mSpells
Definition: creaturestats.hpp:65
Running global script.
Definition: converter.hpp:572
Creature changes.
Definition: importcrec.hpp:16
std::string toString() const
Definition: esmcommon.hpp:58
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:65
void load(ESM::ESMReader &esm)
Definition: importdial.cpp:8
int mYear
Definition: importercontext.hpp:43
std::vector< unsigned int > mFogOfWar
Definition: converter.hpp:348
void load(ESMReader &esm, bool &isDeleted)
Definition: loadcrea.cpp:13
int mCurrentWeather
Definition: importgame.hpp:20
ESM::ControlsState mControlsState
Definition: importercontext.hpp:36
float mWeatherUpdateTime
Definition: weatherstate.hpp:24
TypesetBook::Ptr book
Definition: journalbooks.cpp:156
int getInteger() const
Definition: variant.cpp:82
virtual void read(ESM::ESMReader &esm)
Definition: converter.cpp:68
void load(ESM::ESMReader &esm)
Definition: importplayer.cpp:8
virtual void read(ESM::ESMReader &esm)
Definition: converter.cpp:161
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:162
State for inventories and containers.
Definition: inventorystate.hpp:16
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:362
TContainer mSpells
Definition: spellstate.hpp:37
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:81
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:59
Definition: spellstate.hpp:32
static void lowerCaseInPlace(std::string &inout)
Transforms input string to lower case w/o copy.
Definition: stringops.hpp:97
Definition: loadcell.hpp:64
std::map< std::string, int > mReactions
Definition: loadfact.hpp:60
Default converter: simply reads the record and writes it unmodified to the output.
Definition: converter.hpp:76
int mIndex
Definition: importcrec.hpp:18
void load(ESM::ESMReader &esm)
Definition: importcrec.cpp:8
std::vector< std::string > mUsedIds
Definition: npcstats.hpp:41
void convertNpcData(const ActorData &actorData, ESM::NpcStats &npcStats)
Definition: convertacdt.cpp:46
Definition: converter.hpp:180
float mTimePassed
Definition: weatherstate.hpp:22
std::string mId
Definition: loadglob.hpp:24
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:528
Definition: weatherstate.hpp:19
InventoryState mInventory
Definition: npcstate.hpp:15
ESM::Cell mCell
Definition: converter.hpp:346
StolenItemsMap mStolenItems
Definition: stolenitems.hpp:16
std::pair< std::string, bool > Owner
Definition: converter.hpp:453
const NAME & retSubName() const
Definition: esmreader.hpp:41
ESM::Player mPlayer
Definition: importercontext.hpp:30
int mSelectedEnchantItem
Definition: inventorystate.hpp:28
ESM::DialogueState mDialogueState
Definition: importercontext.hpp:34
int mIndex
Definition: importnpcc.hpp:26
Definition: loadclas.hpp:18
std::map< std::pair< int, std::string >, CNTC > mContainerChanges
Definition: importercontext.hpp:49
std::string getHString()
Definition: esmreader.cpp:114
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:280
Definition: converter.hpp:464
void endRecord(const std::string &name)
Definition: esmwriter.cpp:132
void convertSCPT(const SCPT &scpt, ESM::GlobalScript &out)
Definition: convertscpt.cpp:10
Definition: importinfo.hpp:14
virtual void write(ESM::ESMWriter &esm)
Definition: converter.hpp:90
float getFloat() const
Will throw an exception, if value can not be represented as a float value.
Definition: variant.cpp:90
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:477
bool mTeleportingEnabled
Definition: converter.hpp:300
Player-agnostic player data.
Definition: importplayer.hpp:22
Weather data.
Definition: importgame.hpp:13
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:575
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:235
Definition: converter.hpp:141
void load(ESM::ESMReader &esm)
Definition: importscpt.cpp:10
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:467
Definition: converter.hpp:104
ESM::Position mPos
Definition: importplayer.hpp:27
std::vector< std::string > mList
Definition: spelllist.hpp:18
float mTransitionFactor
Definition: weatherstate.hpp:25
std::map< std::string, Cell > mIntCells
Definition: converter.hpp:351
Definition: npcstats.hpp:17
int validateWeatherID(int weatherID)
Definition: converter.hpp:534
std::vector< ESM::CustomMarker > mMarkers
Definition: converter.hpp:354
Stolen items.
Definition: converter.hpp:406
Definition: loadfact.hpp:30
Other player data.
Definition: importplayer.hpp:34
bool isNextSub(const char *name)
Definition: esmreader.cpp:164
std::map< std::string, DIAL > mDials
Definition: converter.hpp:499
int mCurrentWeather
Definition: weatherstate.hpp:26
std::map< std::string, ESM::Creature > mCreatures
Definition: importercontext.hpp:51
osg::ref_ptr< osg::Image > mGlobalMapImage
Definition: converter.hpp:334
std::map< std::string, std::map< std::string, int > > mChangedFactionReaction
Definition: dialoguestate.hpp:21
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:516
void writeCell(const Cell &cell, ESM::ESMWriter &esm)
Definition: converter.cpp:286
int mQueuedWeather
Definition: weatherstate.hpp:28
unsigned char mFinished
Definition: queststate.hpp:17
std::string mCustomPlayerClassName
Definition: importercontext.hpp:32
GMDT mGMDT
Definition: importgame.hpp:26
Definition: converter.hpp:212
Definition: loadbook.hpp:15
Definition: converter.hpp:232
Definition: converter.hpp:337
void convertNPCC(const NPCC &npcc, ESM::NpcState &npcState)
Definition: convertnpcc.cpp:8
NPDTstruct52 mNpdt52
Definition: loadnpc.hpp:107
void load(ESM::ESMReader &esm)
Definition: importjour.cpp:8
std::map< std::pair< int, std::string >, NPCC > mNpcChanges
Definition: importercontext.hpp:48
void load(ESM::ESMReader &esm)
Definition: importques.cpp:8
virtual void read(ESM::ESMReader &esm)
Definition: converter.hpp:505
Changed container contents.
Definition: importcntc.hpp:15
Definition: converter.hpp:344
float mHour
Definition: importercontext.hpp:44
short mLevel
Definition: loadnpc.hpp:76
Definition: importdial.hpp:11
ACDT mACDT
Definition: importacdt.hpp:69
Definition: converter.hpp:502
bool mFirstPersonCam
Definition: converter.hpp:299