mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 01:06:44 +00:00
removed WriteFilterStage class (functionality integrated into WriteCollectionStage)
This commit is contained in:
parent
828536e999
commit
0be1e3d12f
3 changed files with 11 additions and 35 deletions
|
@ -17,7 +17,8 @@ CSMDoc::Saving::Saving (Document& document, const boost::filesystem::path& proje
|
|||
|
||||
appendStage (new WriteHeaderStage (mDocument, mState, true));
|
||||
|
||||
appendStage (new WriteFilterStage (mDocument, mState, CSMFilter::Filter::Scope_Project));
|
||||
appendStage (new WriteCollectionStage<CSMWorld::IdCollection<CSMFilter::Filter> > (
|
||||
mDocument.getData().getFilters(), mState, CSMWorld::Scope_Project));
|
||||
|
||||
appendStage (new CloseSaveStage (mState));
|
||||
|
||||
|
|
|
@ -201,23 +201,6 @@ void CSMDoc::WriteRefIdCollectionStage::perform (int stage, Messages& messages)
|
|||
}
|
||||
|
||||
|
||||
CSMDoc::WriteFilterStage::WriteFilterStage (Document& document, SavingState& state,
|
||||
CSMFilter::Filter::Scope scope)
|
||||
: WriteCollectionStage<CSMWorld::IdCollection<CSMFilter::Filter> > (document.getData().getFilters(),
|
||||
state),
|
||||
mDocument (document), mScope (scope)
|
||||
{}
|
||||
|
||||
void CSMDoc::WriteFilterStage::perform (int stage, Messages& messages)
|
||||
{
|
||||
const CSMWorld::Record<CSMFilter::Filter>& record =
|
||||
mDocument.getData().getFilters().getRecord (stage);
|
||||
|
||||
if (record.get().mScope==mScope)
|
||||
WriteCollectionStage<CSMWorld::IdCollection<CSMFilter::Filter> >::perform (stage, messages);
|
||||
}
|
||||
|
||||
|
||||
CSMDoc::CollectionReferencesStage::CollectionReferencesStage (Document& document,
|
||||
SavingState& state)
|
||||
: mDocument (document), mState (state)
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "../world/record.hpp"
|
||||
#include "../world/idcollection.hpp"
|
||||
#include "../world/scope.hpp"
|
||||
|
||||
#include "../filter/filter.hpp"
|
||||
|
||||
|
@ -67,10 +68,12 @@ namespace CSMDoc
|
|||
{
|
||||
const CollectionT& mCollection;
|
||||
SavingState& mState;
|
||||
CSMWorld::Scope mScope;
|
||||
|
||||
public:
|
||||
|
||||
WriteCollectionStage (const CollectionT& collection, SavingState& state);
|
||||
WriteCollectionStage (const CollectionT& collection, SavingState& state,
|
||||
CSMWorld::Scope scope = CSMWorld::Scope_Content);
|
||||
|
||||
virtual int setup();
|
||||
///< \return number of steps
|
||||
|
@ -81,8 +84,8 @@ namespace CSMDoc
|
|||
|
||||
template<class CollectionT>
|
||||
WriteCollectionStage<CollectionT>::WriteCollectionStage (const CollectionT& collection,
|
||||
SavingState& state)
|
||||
: mCollection (collection), mState (state)
|
||||
SavingState& state, CSMWorld::Scope scope)
|
||||
: mCollection (collection), mState (state), mScope (scope)
|
||||
{}
|
||||
|
||||
template<class CollectionT>
|
||||
|
@ -94,6 +97,9 @@ namespace CSMDoc
|
|||
template<class CollectionT>
|
||||
void WriteCollectionStage<CollectionT>::perform (int stage, Messages& messages)
|
||||
{
|
||||
if (CSMWorld::getScopeFromId (mCollection.getRecord (stage).get().mId)!=mScope)
|
||||
return;
|
||||
|
||||
CSMWorld::RecordBase::State state = mCollection.getRecord (stage).mState;
|
||||
|
||||
if (state==CSMWorld::RecordBase::State_Modified ||
|
||||
|
@ -152,20 +158,6 @@ namespace CSMDoc
|
|||
};
|
||||
|
||||
|
||||
class WriteFilterStage : public WriteCollectionStage<CSMWorld::IdCollection<CSMFilter::Filter> >
|
||||
{
|
||||
Document& mDocument;
|
||||
CSMFilter::Filter::Scope mScope;
|
||||
|
||||
public:
|
||||
|
||||
WriteFilterStage (Document& document, SavingState& state, CSMFilter::Filter::Scope scope);
|
||||
|
||||
virtual void perform (int stage, Messages& messages);
|
||||
///< Messages resulting from this stage will be appended to \a messages.
|
||||
|
||||
};
|
||||
|
||||
class CollectionReferencesStage : public Stage
|
||||
{
|
||||
Document& mDocument;
|
||||
|
|
Loading…
Reference in a new issue