mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 11:06:43 +00:00
added info tables and pathgrid table to merge operation
This commit is contained in:
parent
c92898a5bc
commit
103073150e
2 changed files with 11 additions and 10 deletions
|
@ -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::SoundGenerator> (mState, &CSMWorld::Data::getSoundGens));
|
||||||
appendStage (new MergeIdCollectionStage<ESM::MagicEffect> (mState, &CSMWorld::Data::getMagicEffects));
|
appendStage (new MergeIdCollectionStage<ESM::MagicEffect> (mState, &CSMWorld::Data::getMagicEffects));
|
||||||
appendStage (new MergeIdCollectionStage<ESM::StartScript> (mState, &CSMWorld::Data::getStartScripts));
|
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)
|
void CSMTools::MergeOperation::setTarget (std::auto_ptr<CSMDoc::Document> document)
|
||||||
|
|
|
@ -27,11 +27,9 @@ namespace CSMTools
|
||||||
///< Messages resulting from this stage will be appended to \a messages.
|
///< 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
|
class MergeIdCollectionStage : public CSMDoc::Stage
|
||||||
{
|
{
|
||||||
typedef typename CSMWorld::IdCollection<RecordType> Collection;
|
|
||||||
|
|
||||||
MergeState& mState;
|
MergeState& mState;
|
||||||
Collection& (CSMWorld::Data::*mAccessor)();
|
Collection& (CSMWorld::Data::*mAccessor)();
|
||||||
|
|
||||||
|
@ -46,19 +44,19 @@ namespace CSMTools
|
||||||
///< Messages resulting from this stage will be appended to \a messages.
|
///< Messages resulting from this stage will be appended to \a messages.
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename RecordType>
|
template<typename RecordType, typename Collection>
|
||||||
MergeIdCollectionStage<RecordType>::MergeIdCollectionStage (MergeState& state, Collection& (CSMWorld::Data::*accessor)())
|
MergeIdCollectionStage<RecordType, Collection>::MergeIdCollectionStage (MergeState& state, Collection& (CSMWorld::Data::*accessor)())
|
||||||
: mState (state), mAccessor (accessor)
|
: mState (state), mAccessor (accessor)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template<typename RecordType>
|
template<typename RecordType, typename Collection>
|
||||||
int MergeIdCollectionStage<RecordType>::setup()
|
int MergeIdCollectionStage<RecordType, Collection>::setup()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename RecordType>
|
template<typename RecordType, typename Collection>
|
||||||
void MergeIdCollectionStage<RecordType>::perform (int stage, CSMDoc::Messages& messages)
|
void MergeIdCollectionStage<RecordType, Collection>::perform (int stage, CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
const Collection& source = (mState.mSource.getData().*mAccessor)();
|
const Collection& source = (mState.mSource.getData().*mAccessor)();
|
||||||
Collection& target = (mState.mTarget->getData().*mAccessor)();
|
Collection& target = (mState.mTarget->getData().*mAccessor)();
|
||||||
|
|
Loading…
Reference in a new issue