1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 21:19:55 +00:00

added info tables and pathgrid table to merge operation

This commit is contained in:
Marc Zinnschlag 2015-08-23 12:58:49 +02:00
parent c92898a5bc
commit 103073150e
2 changed files with 11 additions and 10 deletions

View file

@ -31,8 +31,11 @@ CSMTools::MergeOperation::MergeOperation (CSMDoc::Document& document, ToUTF8::Fr
appendStage (new MergeIdCollectionStage<ESM::SoundGenerator> (mState, &CSMWorld::Data::getSoundGens));
appendStage (new MergeIdCollectionStage<ESM::MagicEffect> (mState, &CSMWorld::Data::getMagicEffects));
appendStage (new MergeIdCollectionStage<ESM::StartScript> (mState, &CSMWorld::Data::getStartScripts));
appendStage (new MergeIdCollectionStage<CSMWorld::Pathgrid, CSMWorld::SubCellCollection<CSMWorld::Pathgrid> > (mState, &CSMWorld::Data::getPathgrids));
appendStage (new MergeIdCollectionStage<CSMWorld::Info, CSMWorld::InfoCollection> (mState, &CSMWorld::Data::getTopicInfos));
appendStage (new MergeIdCollectionStage<CSMWorld::Info, CSMWorld::InfoCollection> (mState, &CSMWorld::Data::getJournalInfos));
/// \todo TopicInfo, JournalInfo, Referencables, References, Land, LandTextures, Pathgrids
/// \todo Referencables, References, Land, LandTextures
}
void CSMTools::MergeOperation::setTarget (std::auto_ptr<CSMDoc::Document> document)

View file

@ -27,11 +27,9 @@ namespace CSMTools
///< Messages resulting from this stage will be appended to \a messages.
};
template<typename RecordType>
template<typename RecordType, typename Collection = CSMWorld::IdCollection<RecordType> >
class MergeIdCollectionStage : public CSMDoc::Stage
{
typedef typename CSMWorld::IdCollection<RecordType> Collection;
MergeState& mState;
Collection& (CSMWorld::Data::*mAccessor)();
@ -46,19 +44,19 @@ namespace CSMTools
///< Messages resulting from this stage will be appended to \a messages.
};
template<typename RecordType>
MergeIdCollectionStage<RecordType>::MergeIdCollectionStage (MergeState& state, Collection& (CSMWorld::Data::*accessor)())
template<typename RecordType, typename Collection>
MergeIdCollectionStage<RecordType, Collection>::MergeIdCollectionStage (MergeState& state, Collection& (CSMWorld::Data::*accessor)())
: mState (state), mAccessor (accessor)
{}
template<typename RecordType>
int MergeIdCollectionStage<RecordType>::setup()
template<typename RecordType, typename Collection>
int MergeIdCollectionStage<RecordType, Collection>::setup()
{
return 1;
}
template<typename RecordType>
void MergeIdCollectionStage<RecordType>::perform (int stage, CSMDoc::Messages& messages)
template<typename RecordType, typename Collection>
void MergeIdCollectionStage<RecordType, Collection>::perform (int stage, CSMDoc::Messages& messages)
{
const Collection& source = (mState.mSource.getData().*mAccessor)();
Collection& target = (mState.mTarget->getData().*mAccessor)();