|
|
|
@ -59,8 +59,8 @@ int CSMWorld::Data::count (RecordBase::State state, const CollectionBase& collec
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourcesManager)
|
|
|
|
|
: mEncoder (encoding), mRefs (mCells), mResourcesManager (resourcesManager), mReader (0),
|
|
|
|
|
mDialogue (0)
|
|
|
|
|
: mEncoder (encoding), mPathgrids (mCells), mRefs (mCells),
|
|
|
|
|
mResourcesManager (resourcesManager), mReader (0), mDialogue (0)
|
|
|
|
|
{
|
|
|
|
|
mGlobals.addColumn (new StringIdColumn<ESM::Global>);
|
|
|
|
|
mGlobals.addColumn (new RecordStateColumn<ESM::Global>);
|
|
|
|
@ -71,7 +71,6 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
|
|
|
|
mGmsts.addColumn (new StringIdColumn<ESM::GameSetting>);
|
|
|
|
|
mGmsts.addColumn (new RecordStateColumn<ESM::GameSetting>);
|
|
|
|
|
mGmsts.addColumn (new FixedRecordTypeColumn<ESM::GameSetting> (UniversalId::Type_Gmst));
|
|
|
|
|
mGmsts.addColumn (new FixedRecordTypeColumn<ESM::GameSetting> (UniversalId::Type_Gmst));
|
|
|
|
|
mGmsts.addColumn (new VarTypeColumn<ESM::GameSetting> (ColumnBase::Display_GmstVarType));
|
|
|
|
|
mGmsts.addColumn (new VarValueColumn<ESM::GameSetting>);
|
|
|
|
|
|
|
|
|
@ -221,6 +220,40 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
|
|
|
|
mBodyParts.addColumn (new ModelColumn<ESM::BodyPart>);
|
|
|
|
|
mBodyParts.addColumn (new RaceColumn<ESM::BodyPart>);
|
|
|
|
|
|
|
|
|
|
mSoundGens.addColumn (new StringIdColumn<ESM::SoundGenerator>);
|
|
|
|
|
mSoundGens.addColumn (new RecordStateColumn<ESM::SoundGenerator>);
|
|
|
|
|
mSoundGens.addColumn (new FixedRecordTypeColumn<ESM::SoundGenerator> (UniversalId::Type_SoundGen));
|
|
|
|
|
mSoundGens.addColumn (new CreatureColumn<ESM::SoundGenerator>);
|
|
|
|
|
mSoundGens.addColumn (new SoundColumn<ESM::SoundGenerator>);
|
|
|
|
|
mSoundGens.addColumn (new SoundGeneratorTypeColumn<ESM::SoundGenerator>);
|
|
|
|
|
|
|
|
|
|
mMagicEffects.addColumn (new StringIdColumn<ESM::MagicEffect>);
|
|
|
|
|
mMagicEffects.addColumn (new RecordStateColumn<ESM::MagicEffect>);
|
|
|
|
|
mMagicEffects.addColumn (new FixedRecordTypeColumn<ESM::MagicEffect> (UniversalId::Type_MagicEffect));
|
|
|
|
|
mMagicEffects.addColumn (new SchoolColumn<ESM::MagicEffect>);
|
|
|
|
|
mMagicEffects.addColumn (new BaseCostColumn<ESM::MagicEffect>);
|
|
|
|
|
mMagicEffects.addColumn (new EffectTextureColumn<ESM::MagicEffect> (Columns::ColumnId_Icon));
|
|
|
|
|
mMagicEffects.addColumn (new EffectTextureColumn<ESM::MagicEffect> (Columns::ColumnId_Particle));
|
|
|
|
|
mMagicEffects.addColumn (new EffectObjectColumn<ESM::MagicEffect> (Columns::ColumnId_CastingObject));
|
|
|
|
|
mMagicEffects.addColumn (new EffectObjectColumn<ESM::MagicEffect> (Columns::ColumnId_HitObject));
|
|
|
|
|
mMagicEffects.addColumn (new EffectObjectColumn<ESM::MagicEffect> (Columns::ColumnId_AreaObject));
|
|
|
|
|
mMagicEffects.addColumn (new EffectObjectColumn<ESM::MagicEffect> (Columns::ColumnId_BoltObject));
|
|
|
|
|
mMagicEffects.addColumn (new EffectSoundColumn<ESM::MagicEffect> (Columns::ColumnId_CastingSound));
|
|
|
|
|
mMagicEffects.addColumn (new EffectSoundColumn<ESM::MagicEffect> (Columns::ColumnId_HitSound));
|
|
|
|
|
mMagicEffects.addColumn (new EffectSoundColumn<ESM::MagicEffect> (Columns::ColumnId_AreaSound));
|
|
|
|
|
mMagicEffects.addColumn (new EffectSoundColumn<ESM::MagicEffect> (Columns::ColumnId_BoltSound));
|
|
|
|
|
mMagicEffects.addColumn (new FlagColumn<ESM::MagicEffect> (
|
|
|
|
|
Columns::ColumnId_AllowSpellmaking, ESM::MagicEffect::AllowSpellmaking));
|
|
|
|
|
mMagicEffects.addColumn (new FlagColumn<ESM::MagicEffect> (
|
|
|
|
|
Columns::ColumnId_AllowEnchanting, ESM::MagicEffect::AllowEnchanting));
|
|
|
|
|
mMagicEffects.addColumn (new FlagColumn<ESM::MagicEffect> (
|
|
|
|
|
Columns::ColumnId_NegativeLight, ESM::MagicEffect::NegativeLight));
|
|
|
|
|
mMagicEffects.addColumn (new DescriptionColumn<ESM::MagicEffect>);
|
|
|
|
|
|
|
|
|
|
mPathgrids.addColumn (new StringIdColumn<Pathgrid>);
|
|
|
|
|
mPathgrids.addColumn (new RecordStateColumn<Pathgrid>);
|
|
|
|
|
mPathgrids.addColumn (new FixedRecordTypeColumn<Pathgrid> (UniversalId::Type_Pathgrid));
|
|
|
|
|
|
|
|
|
|
mRefs.addColumn (new StringIdColumn<CellRef> (true));
|
|
|
|
|
mRefs.addColumn (new RecordStateColumn<CellRef>);
|
|
|
|
|
mRefs.addColumn (new FixedRecordTypeColumn<CellRef> (UniversalId::Type_Reference));
|
|
|
|
@ -291,6 +324,9 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
|
|
|
|
addModel (new IdTable (&mCells, IdTable::Feature_ViewId), UniversalId::Type_Cell);
|
|
|
|
|
addModel (new IdTable (&mEnchantments), UniversalId::Type_Enchantment);
|
|
|
|
|
addModel (new IdTable (&mBodyParts), UniversalId::Type_BodyPart);
|
|
|
|
|
addModel (new IdTable (&mSoundGens), UniversalId::Type_SoundGen);
|
|
|
|
|
addModel (new IdTable (&mMagicEffects), UniversalId::Type_MagicEffect);
|
|
|
|
|
addModel (new IdTable (&mPathgrids), UniversalId::Type_Pathgrid);
|
|
|
|
|
addModel (new IdTable (&mReferenceables, IdTable::Feature_Preview),
|
|
|
|
|
UniversalId::Type_Referenceable);
|
|
|
|
|
addModel (new IdTable (&mRefs, IdTable::Feature_ViewCell | IdTable::Feature_Preview), UniversalId::Type_Reference);
|
|
|
|
@ -549,6 +585,36 @@ const CSMWorld::IdCollection<CSMWorld::LandTexture>& CSMWorld::Data::getLandText
|
|
|
|
|
return mLandTextures;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CSMWorld::IdCollection<ESM::SoundGenerator>& CSMWorld::Data::getSoundGens() const
|
|
|
|
|
{
|
|
|
|
|
return mSoundGens;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::SoundGenerator>& CSMWorld::Data::getSoundGens()
|
|
|
|
|
{
|
|
|
|
|
return mSoundGens;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CSMWorld::IdCollection<ESM::MagicEffect>& CSMWorld::Data::getMagicEffects() const
|
|
|
|
|
{
|
|
|
|
|
return mMagicEffects;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSMWorld::IdCollection<ESM::MagicEffect>& CSMWorld::Data::getMagicEffects()
|
|
|
|
|
{
|
|
|
|
|
return mMagicEffects;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CSMWorld::SubCellCollection<CSMWorld::Pathgrid>& CSMWorld::Data::getPathgrids() const
|
|
|
|
|
{
|
|
|
|
|
return mPathgrids;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CSMWorld::SubCellCollection<CSMWorld::Pathgrid>& CSMWorld::Data::getPathgrids()
|
|
|
|
|
{
|
|
|
|
|
return mPathgrids;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const CSMWorld::Resources& CSMWorld::Data::getResources (const UniversalId& id) const
|
|
|
|
|
{
|
|
|
|
|
return mResourcesManager.get (id.getType());
|
|
|
|
@ -641,6 +707,9 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Stage::Messages& messages)
|
|
|
|
|
case ESM::REC_SPEL: mSpells.load (*mReader, mBase); break;
|
|
|
|
|
case ESM::REC_ENCH: mEnchantments.load (*mReader, mBase); break;
|
|
|
|
|
case ESM::REC_BODY: mBodyParts.load (*mReader, mBase); break;
|
|
|
|
|
case ESM::REC_SNDG: mSoundGens.load (*mReader, mBase); break;
|
|
|
|
|
case ESM::REC_MGEF: mMagicEffects.load (*mReader, mBase); break;
|
|
|
|
|
case ESM::REC_PGRD: mPathgrids.load (*mReader, mBase); break;
|
|
|
|
|
|
|
|
|
|
case ESM::REC_LTEX: mLandTextures.load (*mReader, mBase); break;
|
|
|
|
|
case ESM::REC_LAND: mLand.load(*mReader, mBase); break;
|
|
|
|
@ -794,9 +863,9 @@ bool CSMWorld::Data::hasId (const std::string& id) const
|
|
|
|
|
getCells().searchId (id)!=-1 ||
|
|
|
|
|
getEnchantments().searchId (id)!=-1 ||
|
|
|
|
|
getBodyParts().searchId (id)!=-1 ||
|
|
|
|
|
getReferenceables().searchId (id)!=-1 ||
|
|
|
|
|
getLand().searchId (id) != -1 ||
|
|
|
|
|
getLandTextures().searchId (id) != -1;
|
|
|
|
|
getSoundGens().searchId (id)!=-1 ||
|
|
|
|
|
getMagicEffects().searchId (id)!=-1 ||
|
|
|
|
|
getReferenceables().searchId (id)!=-1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CSMWorld::Data::count (RecordBase::State state) const
|
|
|
|
@ -816,9 +885,12 @@ int CSMWorld::Data::count (RecordBase::State state) const
|
|
|
|
|
count (state, mCells) +
|
|
|
|
|
count (state, mEnchantments) +
|
|
|
|
|
count (state, mBodyParts) +
|
|
|
|
|
count (state, mReferenceables) +
|
|
|
|
|
count (state, mLand) +
|
|
|
|
|
count (state, mLandTextures);
|
|
|
|
|
count (state, mLandTextures) +
|
|
|
|
|
count (state, mSoundGens) +
|
|
|
|
|
count (state, mMagicEffects) +
|
|
|
|
|
count (state, mReferenceables) +
|
|
|
|
|
count (state, mPathgrids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSMWorld::Data::setDescription (const std::string& description)
|
|
|
|
@ -860,9 +932,9 @@ std::vector<std::string> CSMWorld::Data::getIds (bool listDeleted) const
|
|
|
|
|
appendIds (ids, mCells, listDeleted);
|
|
|
|
|
appendIds (ids, mEnchantments, listDeleted);
|
|
|
|
|
appendIds (ids, mBodyParts, listDeleted);
|
|
|
|
|
appendIds (ids, mSoundGens, listDeleted);
|
|
|
|
|
appendIds (ids, mMagicEffects, listDeleted);
|
|
|
|
|
appendIds (ids, mReferenceables, listDeleted);
|
|
|
|
|
appendIds (ids, mLand, listDeleted);
|
|
|
|
|
appendIds (ids, mLandTextures, listDeleted);
|
|
|
|
|
|
|
|
|
|
std::sort (ids.begin(), ids.end());
|
|
|
|
|
|
|
|
|
|