2012-12-08 22:27:59 +00:00
|
|
|
#include "mandatoryid.hpp"
|
|
|
|
|
2013-06-17 09:42:02 +00:00
|
|
|
#include "../world/collectionbase.hpp"
|
2012-12-08 22:27:59 +00:00
|
|
|
|
2013-06-17 09:42:02 +00:00
|
|
|
#include "../world/record.hpp"
|
|
|
|
|
|
|
|
CSMTools::MandatoryIdStage::MandatoryIdStage (const CSMWorld::CollectionBase& idCollection,
|
2012-12-08 22:27:59 +00:00
|
|
|
const CSMWorld::UniversalId& collectionId, const std::vector<std::string>& ids)
|
|
|
|
: mIdCollection (idCollection), mCollectionId (collectionId), mIds (ids)
|
|
|
|
{}
|
|
|
|
|
|
|
|
int CSMTools::MandatoryIdStage::setup()
|
|
|
|
{
|
|
|
|
return mIds.size();
|
|
|
|
}
|
|
|
|
|
2014-12-07 17:57:47 +00:00
|
|
|
void CSMTools::MandatoryIdStage::perform (int stage, CSMDoc::Messages& messages)
|
2012-12-08 22:27:59 +00:00
|
|
|
{
|
|
|
|
if (mIdCollection.searchId (mIds.at (stage))==-1 ||
|
|
|
|
mIdCollection.getRecord (mIds.at (stage)).isDeleted())
|
2014-12-07 17:57:47 +00:00
|
|
|
messages.add (mCollectionId, "Missing mandatory record: " + mIds.at (stage));
|
2015-03-11 14:54:45 +00:00
|
|
|
}
|