2012-11-26 11:29:22 +00:00
|
|
|
|
|
|
|
#include "data.hpp"
|
|
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
2013-03-21 09:07:25 +00:00
|
|
|
#include <QAbstractItemModel>
|
2012-11-26 11:29:22 +00:00
|
|
|
|
2013-02-07 11:52:01 +00:00
|
|
|
#include <components/esm/esmreader.hpp>
|
2013-03-05 07:02:27 +00:00
|
|
|
#include <components/esm/defs.hpp>
|
2012-11-26 11:29:22 +00:00
|
|
|
#include <components/esm/loadglob.hpp>
|
|
|
|
|
|
|
|
#include "idtable.hpp"
|
|
|
|
#include "columns.hpp"
|
|
|
|
|
2013-03-21 09:07:25 +00:00
|
|
|
void CSMWorld::Data::addModel (QAbstractItemModel *model, UniversalId::Type type1,
|
2012-12-30 13:01:52 +00:00
|
|
|
UniversalId::Type type2)
|
|
|
|
{
|
|
|
|
mModels.push_back (model);
|
|
|
|
mModelIndex.insert (std::make_pair (type1, model));
|
|
|
|
|
|
|
|
if (type2!=UniversalId::Type_None)
|
|
|
|
mModelIndex.insert (std::make_pair (type2, model));
|
|
|
|
}
|
|
|
|
|
2012-11-26 11:29:22 +00:00
|
|
|
CSMWorld::Data::Data()
|
|
|
|
{
|
2012-11-29 17:56:28 +00:00
|
|
|
mGlobals.addColumn (new StringIdColumn<ESM::Global>);
|
2012-12-01 12:42:12 +00:00
|
|
|
mGlobals.addColumn (new RecordStateColumn<ESM::Global>);
|
2012-12-13 12:35:08 +00:00
|
|
|
mGlobals.addColumn (new FixedRecordTypeColumn<ESM::Global> (UniversalId::Type_Global));
|
2013-03-05 10:37:13 +00:00
|
|
|
mGlobals.addColumn (new VarTypeColumn<ESM::Global> (ColumnBase::Display_GlobalVarType));
|
|
|
|
mGlobals.addColumn (new VarValueColumn<ESM::Global>);
|
2012-11-26 11:29:22 +00:00
|
|
|
|
2013-02-08 08:58:19 +00:00
|
|
|
mGmsts.addColumn (new StringIdColumn<ESM::GameSetting>);
|
|
|
|
mGmsts.addColumn (new RecordStateColumn<ESM::GameSetting>);
|
|
|
|
mGmsts.addColumn (new FixedRecordTypeColumn<ESM::GameSetting> (UniversalId::Type_Gmst));
|
2013-04-09 12:27:32 +00:00
|
|
|
mGmsts.addColumn (new FixedRecordTypeColumn<ESM::GameSetting> (UniversalId::Type_Gmst));
|
2013-03-05 10:37:13 +00:00
|
|
|
mGmsts.addColumn (new VarTypeColumn<ESM::GameSetting> (ColumnBase::Display_GmstVarType));
|
2013-02-08 13:48:38 +00:00
|
|
|
mGmsts.addColumn (new VarValueColumn<ESM::GameSetting>);
|
2013-02-08 08:58:19 +00:00
|
|
|
|
2013-03-21 13:31:32 +00:00
|
|
|
mSkills.addColumn (new StringIdColumn<ESM::Skill>);
|
|
|
|
mSkills.addColumn (new RecordStateColumn<ESM::Skill>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mSkills.addColumn (new FixedRecordTypeColumn<ESM::Skill> (UniversalId::Type_Skill));
|
2013-03-24 14:50:29 +00:00
|
|
|
mSkills.addColumn (new AttributeColumn<ESM::Skill>);
|
2013-03-23 12:13:53 +00:00
|
|
|
mSkills.addColumn (new SpecialisationColumn<ESM::Skill>);
|
2013-03-24 13:51:48 +00:00
|
|
|
for (int i=0; i<4; ++i)
|
|
|
|
mSkills.addColumn (new UseValueColumn<ESM::Skill> (i));
|
2013-03-21 13:38:06 +00:00
|
|
|
mSkills.addColumn (new DescriptionColumn<ESM::Skill>);
|
|
|
|
|
2013-03-25 12:22:06 +00:00
|
|
|
mClasses.addColumn (new StringIdColumn<ESM::Class>);
|
|
|
|
mClasses.addColumn (new RecordStateColumn<ESM::Class>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mClasses.addColumn (new FixedRecordTypeColumn<ESM::Class> (UniversalId::Type_Class));
|
2013-03-25 13:31:46 +00:00
|
|
|
mClasses.addColumn (new NameColumn<ESM::Class>);
|
|
|
|
mClasses.addColumn (new AttributesColumn<ESM::Class> (0));
|
|
|
|
mClasses.addColumn (new AttributesColumn<ESM::Class> (1));
|
2013-03-25 12:22:06 +00:00
|
|
|
mClasses.addColumn (new SpecialisationColumn<ESM::Class>);
|
2013-03-26 08:43:13 +00:00
|
|
|
for (int i=0; i<5; ++i)
|
2013-04-02 12:04:13 +00:00
|
|
|
mClasses.addColumn (new SkillsColumn<ESM::Class> (i, true, true));
|
2013-03-26 08:43:13 +00:00
|
|
|
for (int i=0; i<5; ++i)
|
2013-04-02 12:04:13 +00:00
|
|
|
mClasses.addColumn (new SkillsColumn<ESM::Class> (i, true, false));
|
2013-03-26 08:51:39 +00:00
|
|
|
mClasses.addColumn (new PlayableColumn<ESM::Class>);
|
2013-03-25 12:22:06 +00:00
|
|
|
mClasses.addColumn (new DescriptionColumn<ESM::Class>);
|
|
|
|
|
2013-04-02 10:00:45 +00:00
|
|
|
mFactions.addColumn (new StringIdColumn<ESM::Faction>);
|
|
|
|
mFactions.addColumn (new RecordStateColumn<ESM::Faction>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mFactions.addColumn (new FixedRecordTypeColumn<ESM::Faction> (UniversalId::Type_Faction));
|
2013-04-02 10:00:45 +00:00
|
|
|
mFactions.addColumn (new NameColumn<ESM::Faction>);
|
2013-04-04 08:58:53 +00:00
|
|
|
mFactions.addColumn (new AttributesColumn<ESM::Faction> (0));
|
|
|
|
mFactions.addColumn (new AttributesColumn<ESM::Faction> (1));
|
2013-04-02 12:20:51 +00:00
|
|
|
mFactions.addColumn (new HiddenColumn<ESM::Faction>);
|
2013-04-02 12:04:13 +00:00
|
|
|
for (int i=0; i<6; ++i)
|
|
|
|
mFactions.addColumn (new SkillsColumn<ESM::Faction> (i));
|
2013-04-02 10:00:45 +00:00
|
|
|
|
2013-04-04 12:34:39 +00:00
|
|
|
mRaces.addColumn (new StringIdColumn<ESM::Race>);
|
|
|
|
mRaces.addColumn (new RecordStateColumn<ESM::Race>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mRaces.addColumn (new FixedRecordTypeColumn<ESM::Race> (UniversalId::Type_Race));
|
2013-04-04 12:34:39 +00:00
|
|
|
mRaces.addColumn (new NameColumn<ESM::Race>);
|
|
|
|
mRaces.addColumn (new DescriptionColumn<ESM::Race>);
|
2013-04-05 10:48:05 +00:00
|
|
|
mRaces.addColumn (new FlagColumn<ESM::Race> ("Playable", 0x1));
|
|
|
|
mRaces.addColumn (new FlagColumn<ESM::Race> ("Beast Race", 0x2));
|
2013-04-05 11:46:48 +00:00
|
|
|
mRaces.addColumn (new WeightHeightColumn<ESM::Race> (true, true));
|
|
|
|
mRaces.addColumn (new WeightHeightColumn<ESM::Race> (true, false));
|
|
|
|
mRaces.addColumn (new WeightHeightColumn<ESM::Race> (false, true));
|
|
|
|
mRaces.addColumn (new WeightHeightColumn<ESM::Race> (false, false));
|
2013-04-04 12:34:39 +00:00
|
|
|
|
2013-04-06 19:21:10 +00:00
|
|
|
mSounds.addColumn (new StringIdColumn<ESM::Sound>);
|
|
|
|
mSounds.addColumn (new RecordStateColumn<ESM::Sound>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mSounds.addColumn (new FixedRecordTypeColumn<ESM::Sound> (UniversalId::Type_Sound));
|
2013-04-06 19:40:03 +00:00
|
|
|
mSounds.addColumn (new SoundParamColumn<ESM::Sound> (SoundParamColumn<ESM::Sound>::Type_Volume));
|
|
|
|
mSounds.addColumn (new SoundParamColumn<ESM::Sound> (SoundParamColumn<ESM::Sound>::Type_MinRange));
|
|
|
|
mSounds.addColumn (new SoundParamColumn<ESM::Sound> (SoundParamColumn<ESM::Sound>::Type_MaxRange));
|
2013-04-06 19:43:05 +00:00
|
|
|
mSounds.addColumn (new SoundFileColumn<ESM::Sound>);
|
2013-04-06 19:21:10 +00:00
|
|
|
|
2013-04-07 13:17:35 +00:00
|
|
|
mScripts.addColumn (new StringIdColumn<ESM::Script>);
|
|
|
|
mScripts.addColumn (new RecordStateColumn<ESM::Script>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mScripts.addColumn (new FixedRecordTypeColumn<ESM::Script> (UniversalId::Type_Script));
|
2013-04-10 18:14:10 +00:00
|
|
|
mScripts.addColumn (new ScriptColumn<ESM::Script>);
|
2013-04-07 13:17:35 +00:00
|
|
|
|
2013-04-07 14:32:06 +00:00
|
|
|
mRegions.addColumn (new StringIdColumn<ESM::Region>);
|
|
|
|
mRegions.addColumn (new RecordStateColumn<ESM::Region>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mRegions.addColumn (new FixedRecordTypeColumn<ESM::Region> (UniversalId::Type_Region));
|
2013-04-07 14:32:06 +00:00
|
|
|
mRegions.addColumn (new NameColumn<ESM::Region>);
|
2013-04-07 14:56:21 +00:00
|
|
|
mRegions.addColumn (new MapColourColumn<ESM::Region>);
|
2013-04-07 17:29:15 +00:00
|
|
|
mRegions.addColumn (new SleepListColumn<ESM::Region>);
|
2013-04-07 14:32:06 +00:00
|
|
|
|
2013-04-07 18:26:39 +00:00
|
|
|
mBirthsigns.addColumn (new StringIdColumn<ESM::BirthSign>);
|
|
|
|
mBirthsigns.addColumn (new RecordStateColumn<ESM::BirthSign>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mBirthsigns.addColumn (new FixedRecordTypeColumn<ESM::BirthSign> (UniversalId::Type_Birthsign));
|
2013-04-07 18:26:39 +00:00
|
|
|
mBirthsigns.addColumn (new NameColumn<ESM::BirthSign>);
|
2013-04-07 18:46:04 +00:00
|
|
|
mBirthsigns.addColumn (new TextureColumn<ESM::BirthSign>);
|
2013-04-07 18:26:39 +00:00
|
|
|
mBirthsigns.addColumn (new DescriptionColumn<ESM::BirthSign>);
|
|
|
|
|
2013-04-09 09:40:36 +00:00
|
|
|
mSpells.addColumn (new StringIdColumn<ESM::Spell>);
|
|
|
|
mSpells.addColumn (new RecordStateColumn<ESM::Spell>);
|
2013-04-09 12:27:32 +00:00
|
|
|
mSpells.addColumn (new FixedRecordTypeColumn<ESM::Spell> (UniversalId::Type_Spell));
|
2013-04-09 09:40:36 +00:00
|
|
|
mSpells.addColumn (new NameColumn<ESM::Spell>);
|
2013-04-09 09:53:47 +00:00
|
|
|
mSpells.addColumn (new SpellTypeColumn<ESM::Spell>);
|
|
|
|
mSpells.addColumn (new CostColumn<ESM::Spell>);
|
2013-04-09 09:40:36 +00:00
|
|
|
mSpells.addColumn (new FlagColumn<ESM::Spell> ("Autocalc", 0x1));
|
|
|
|
mSpells.addColumn (new FlagColumn<ESM::Spell> ("Starter Spell", 0x2));
|
|
|
|
mSpells.addColumn (new FlagColumn<ESM::Spell> ("Always Succeeds", 0x4));
|
|
|
|
|
2013-04-14 15:04:55 +00:00
|
|
|
mCells.addColumn (new StringIdColumn<Cell>);
|
|
|
|
mCells.addColumn (new RecordStateColumn<Cell>);
|
|
|
|
mCells.addColumn (new FixedRecordTypeColumn<Cell> (UniversalId::Type_Cell));
|
|
|
|
mCells.addColumn (new NameColumn<Cell>);
|
2013-04-14 15:10:37 +00:00
|
|
|
mCells.addColumn (new FlagColumn<Cell> ("Sleep forbidden", ESM::Cell::NoSleep));
|
|
|
|
mCells.addColumn (new FlagColumn<Cell> ("Interior Water", ESM::Cell::HasWater));
|
|
|
|
mCells.addColumn (new FlagColumn<Cell> ("Interior Sky", ESM::Cell::QuasiEx));
|
2013-04-14 17:34:55 +00:00
|
|
|
mCells.addColumn (new RegionColumn<Cell>);
|
2013-04-14 15:04:55 +00:00
|
|
|
|
2012-12-30 13:01:52 +00:00
|
|
|
addModel (new IdTable (&mGlobals), UniversalId::Type_Globals, UniversalId::Type_Global);
|
2013-02-08 08:58:19 +00:00
|
|
|
addModel (new IdTable (&mGmsts), UniversalId::Type_Gmsts, UniversalId::Type_Gmst);
|
2013-03-21 13:31:32 +00:00
|
|
|
addModel (new IdTable (&mSkills), UniversalId::Type_Skills, UniversalId::Type_Skill);
|
2013-03-25 12:22:06 +00:00
|
|
|
addModel (new IdTable (&mClasses), UniversalId::Type_Classes, UniversalId::Type_Class);
|
2013-04-02 10:00:45 +00:00
|
|
|
addModel (new IdTable (&mFactions), UniversalId::Type_Factions, UniversalId::Type_Faction);
|
2013-04-04 12:34:39 +00:00
|
|
|
addModel (new IdTable (&mRaces), UniversalId::Type_Races, UniversalId::Type_Race);
|
2013-04-06 19:21:10 +00:00
|
|
|
addModel (new IdTable (&mSounds), UniversalId::Type_Sounds, UniversalId::Type_Sound);
|
2013-04-07 13:17:35 +00:00
|
|
|
addModel (new IdTable (&mScripts), UniversalId::Type_Scripts, UniversalId::Type_Script);
|
2013-04-07 14:32:06 +00:00
|
|
|
addModel (new IdTable (&mRegions), UniversalId::Type_Regions, UniversalId::Type_Region);
|
2013-04-07 18:26:39 +00:00
|
|
|
addModel (new IdTable (&mBirthsigns), UniversalId::Type_Birthsigns, UniversalId::Type_Birthsign);
|
2013-04-09 09:40:36 +00:00
|
|
|
addModel (new IdTable (&mSpells), UniversalId::Type_Spells, UniversalId::Type_Spell);
|
2013-04-14 15:04:55 +00:00
|
|
|
addModel (new IdTable (&mCells), UniversalId::Type_Cells, UniversalId::Type_Cell);
|
2013-05-07 09:23:18 +00:00
|
|
|
addModel (new IdTable (&mReferenceables), UniversalId::Type_Referenceables,
|
|
|
|
UniversalId::Type_Referenceable);
|
2012-11-26 11:29:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::Data::~Data()
|
|
|
|
{
|
2013-03-21 09:07:25 +00:00
|
|
|
for (std::vector<QAbstractItemModel *>::iterator iter (mModels.begin()); iter!=mModels.end(); ++iter)
|
2012-12-30 13:01:52 +00:00
|
|
|
delete *iter;
|
2012-11-26 11:29:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const CSMWorld::IdCollection<ESM::Global>& CSMWorld::Data::getGlobals() const
|
|
|
|
{
|
|
|
|
return mGlobals;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Global>& CSMWorld::Data::getGlobals()
|
|
|
|
{
|
|
|
|
return mGlobals;
|
|
|
|
}
|
|
|
|
|
2013-02-17 19:03:39 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::GameSetting>& CSMWorld::Data::getGmsts() const
|
|
|
|
{
|
|
|
|
return mGmsts;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::GameSetting>& CSMWorld::Data::getGmsts()
|
|
|
|
{
|
|
|
|
return mGmsts;
|
|
|
|
}
|
|
|
|
|
2013-03-24 14:10:03 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::Skill>& CSMWorld::Data::getSkills() const
|
|
|
|
{
|
|
|
|
return mSkills;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Skill>& CSMWorld::Data::getSkills()
|
|
|
|
{
|
|
|
|
return mSkills;
|
|
|
|
}
|
|
|
|
|
2013-04-04 08:10:26 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::Class>& CSMWorld::Data::getClasses() const
|
|
|
|
{
|
|
|
|
return mClasses;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Class>& CSMWorld::Data::getClasses()
|
|
|
|
{
|
|
|
|
return mClasses;
|
|
|
|
}
|
|
|
|
|
2013-04-02 10:00:45 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::Faction>& CSMWorld::Data::getFactions() const
|
|
|
|
{
|
|
|
|
return mFactions;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Faction>& CSMWorld::Data::getFactions()
|
|
|
|
{
|
|
|
|
return mFactions;
|
|
|
|
}
|
|
|
|
|
2013-04-04 12:34:39 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::Race>& CSMWorld::Data::getRaces() const
|
|
|
|
{
|
|
|
|
return mRaces;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Race>& CSMWorld::Data::getRaces()
|
|
|
|
{
|
|
|
|
return mRaces;
|
|
|
|
}
|
|
|
|
|
2013-04-06 19:21:10 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::Sound>& CSMWorld::Data::getSounds() const
|
|
|
|
{
|
|
|
|
return mSounds;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Sound>& CSMWorld::Data::getSounds()
|
|
|
|
{
|
|
|
|
return mSounds;
|
|
|
|
}
|
|
|
|
|
2013-04-07 13:17:35 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::Script>& CSMWorld::Data::getScripts() const
|
|
|
|
{
|
|
|
|
return mScripts;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Script>& CSMWorld::Data::getScripts()
|
|
|
|
{
|
|
|
|
return mScripts;
|
|
|
|
}
|
|
|
|
|
2013-04-07 14:32:06 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::Region>& CSMWorld::Data::getRegions() const
|
|
|
|
{
|
|
|
|
return mRegions;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Region>& CSMWorld::Data::getRegions()
|
|
|
|
{
|
|
|
|
return mRegions;
|
|
|
|
}
|
|
|
|
|
2013-04-07 18:26:39 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::BirthSign>& CSMWorld::Data::getBirthsigns() const
|
|
|
|
{
|
|
|
|
return mBirthsigns;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::BirthSign>& CSMWorld::Data::getBirthsigns()
|
|
|
|
{
|
|
|
|
return mBirthsigns;
|
|
|
|
}
|
|
|
|
|
2013-04-09 09:40:36 +00:00
|
|
|
const CSMWorld::IdCollection<ESM::Spell>& CSMWorld::Data::getSpells() const
|
|
|
|
{
|
|
|
|
return mSpells;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::Spell>& CSMWorld::Data::getSpells()
|
|
|
|
{
|
|
|
|
return mSpells;
|
|
|
|
}
|
|
|
|
|
2013-04-14 15:04:55 +00:00
|
|
|
const CSMWorld::IdCollection<CSMWorld::Cell>& CSMWorld::Data::getCells() const
|
|
|
|
{
|
|
|
|
return mCells;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<CSMWorld::Cell>& CSMWorld::Data::getCells()
|
|
|
|
{
|
|
|
|
return mCells;
|
|
|
|
}
|
|
|
|
|
2013-05-07 09:23:18 +00:00
|
|
|
const CSMWorld::RefIdCollection& CSMWorld::Data::getReferenceables() const
|
|
|
|
{
|
|
|
|
return mReferenceables;
|
|
|
|
}
|
|
|
|
|
|
|
|
CSMWorld::RefIdCollection& CSMWorld::Data::getReferenceables()
|
|
|
|
{
|
|
|
|
return mReferenceables;
|
|
|
|
}
|
|
|
|
|
2013-03-21 09:07:25 +00:00
|
|
|
QAbstractItemModel *CSMWorld::Data::getTableModel (const UniversalId& id)
|
2012-11-26 11:29:22 +00:00
|
|
|
{
|
2013-03-21 09:07:25 +00:00
|
|
|
std::map<UniversalId::Type, QAbstractItemModel *>::iterator iter = mModelIndex.find (id.getType());
|
2012-11-26 11:29:22 +00:00
|
|
|
|
2012-12-30 13:01:52 +00:00
|
|
|
if (iter==mModelIndex.end())
|
2012-11-26 11:29:22 +00:00
|
|
|
throw std::logic_error ("No table model available for " + id.toString());
|
|
|
|
|
|
|
|
return iter->second;
|
2012-12-03 12:56:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSMWorld::Data::merge()
|
|
|
|
{
|
|
|
|
mGlobals.merge();
|
2013-02-07 10:33:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CSMWorld::Data::loadFile (const boost::filesystem::path& path, bool base)
|
|
|
|
{
|
2013-02-07 11:52:01 +00:00
|
|
|
ESM::ESMReader reader;
|
2013-02-17 18:26:01 +00:00
|
|
|
|
|
|
|
/// \todo set encoding properly, once config implementation has been fixed.
|
|
|
|
ToUTF8::Utf8Encoder encoder (ToUTF8::calculateEncoding ("win1252"));
|
|
|
|
reader.setEncoder (&encoder);
|
|
|
|
|
2013-02-07 11:52:01 +00:00
|
|
|
reader.open (path.string());
|
|
|
|
|
|
|
|
// Note: We do not need to send update signals here, because at this point the model is not connected
|
|
|
|
// to any view.
|
|
|
|
while (reader.hasMoreRecs())
|
|
|
|
{
|
|
|
|
ESM::NAME n = reader.getRecName();
|
|
|
|
reader.getRecHeader();
|
|
|
|
|
|
|
|
switch (n.val)
|
|
|
|
{
|
|
|
|
case ESM::REC_GLOB: mGlobals.load (reader, base); break;
|
2013-02-08 08:58:19 +00:00
|
|
|
case ESM::REC_GMST: mGmsts.load (reader, base); break;
|
2013-03-21 13:31:32 +00:00
|
|
|
case ESM::REC_SKIL: mSkills.load (reader, base); break;
|
2013-03-25 12:22:06 +00:00
|
|
|
case ESM::REC_CLAS: mClasses.load (reader, base); break;
|
2013-04-02 10:00:45 +00:00
|
|
|
case ESM::REC_FACT: mFactions.load (reader, base); break;
|
2013-04-04 12:34:39 +00:00
|
|
|
case ESM::REC_RACE: mRaces.load (reader, base); break;
|
2013-04-06 19:21:10 +00:00
|
|
|
case ESM::REC_SOUN: mSounds.load (reader, base); break;
|
2013-04-07 13:17:35 +00:00
|
|
|
case ESM::REC_SCPT: mScripts.load (reader, base); break;
|
2013-04-07 14:32:06 +00:00
|
|
|
case ESM::REC_REGN: mRegions.load (reader, base); break;
|
2013-04-07 18:26:39 +00:00
|
|
|
case ESM::REC_BSGN: mBirthsigns.load (reader, base); break;
|
2013-04-09 09:40:36 +00:00
|
|
|
case ESM::REC_SPEL: mSpells.load (reader, base); break;
|
2013-04-14 15:04:55 +00:00
|
|
|
case ESM::REC_CELL: mCells.load (reader, base); break;
|
2013-02-07 11:52:01 +00:00
|
|
|
|
2013-05-11 15:01:16 +00:00
|
|
|
case ESM::REC_STAT: mReferenceables.load (reader, base, UniversalId::Type_Static); break;
|
|
|
|
|
2013-02-07 11:52:01 +00:00
|
|
|
default:
|
|
|
|
|
|
|
|
/// \todo throw an exception instead, once all records are implemented
|
|
|
|
reader.skipRecord();
|
|
|
|
}
|
|
|
|
}
|
2012-11-26 11:29:22 +00:00
|
|
|
}
|