2013-04-07 17:39:13 +00:00
|
|
|
|
|
|
|
#include "regioncheck.hpp"
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
#include <components/esm/loadregn.hpp>
|
|
|
|
|
|
|
|
#include "../world/universalid.hpp"
|
|
|
|
|
|
|
|
CSMTools::RegionCheckStage::RegionCheckStage (const CSMWorld::IdCollection<ESM::Region>& regions)
|
|
|
|
: mRegions (regions)
|
|
|
|
{}
|
|
|
|
|
|
|
|
int CSMTools::RegionCheckStage::setup()
|
|
|
|
{
|
|
|
|
return mRegions.getSize();
|
|
|
|
}
|
|
|
|
|
2014-05-08 10:42:29 +00:00
|
|
|
void CSMTools::RegionCheckStage::perform (int stage, Messages& messages)
|
2013-04-07 17:39:13 +00:00
|
|
|
{
|
2013-09-27 08:08:09 +00:00
|
|
|
const CSMWorld::Record<ESM::Region>& record = mRegions.getRecord (stage);
|
|
|
|
|
|
|
|
if (record.isDeleted())
|
|
|
|
return;
|
|
|
|
|
|
|
|
const ESM::Region& region = record.get();
|
2013-04-07 17:39:13 +00:00
|
|
|
|
|
|
|
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Region, region.mId);
|
|
|
|
|
|
|
|
// test for empty name
|
|
|
|
if (region.mName.empty())
|
2014-05-08 10:42:29 +00:00
|
|
|
messages.push_back (std::make_pair (id, region.mId + " has an empty name"));
|
2013-04-07 17:39:13 +00:00
|
|
|
|
|
|
|
/// \todo test that the ID in mSleeplist exists
|
|
|
|
|
|
|
|
/// \todo check data members that can't be edited in the table view
|
|
|
|
}
|