1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 07:45:36 +00:00

removed set sizes, consted sizes, added itemleveledlist check

This commit is contained in:
Marek Kochanowicz 2013-12-26 18:40:47 +01:00
parent 1da56e1790
commit f04a727af6
4 changed files with 37 additions and 48 deletions

View file

@ -10,36 +10,20 @@
CSMTools::ReferenceableCheckStage::ReferenceableCheckStage(const CSMWorld::RefIdData& referenceable) :
mReferencables(referenceable),
mBooksSize(0),
mActivatorsSize(0),
mPotionsSize(0),
mApparatiSize(0),
mArmorsSzie(0),
mClothingSize(0),
mContainersSize(0),
mCreaturesSize(0),
mDoorsSize(0),
mIngredientsSize(0),
mCreaturesLevListsSize(0),
mItemLevelledListsSize(0)
mBooksSize(mReferencables.getBooks().getSize()),
mActivatorsSize(mReferencables.getActivators().getSize()),
mPotionsSize(mReferencables.getPotions().getSize()),
mApparatiSize(mReferencables.getApparati().getSize()),
mArmorsSzie(mReferencables.getArmors().getSize()),
mClothingSize(mReferencables.getClothing().getSize()),
mContainersSize(mReferencables.getContainers().getSize()),
mCreaturesSize(mReferencables.getCreatures().getSize()),
mDoorsSize(mReferencables.getDoors().getSize()),
mIngredientsSize(mReferencables.getIngredients().getSize()),
mCreaturesLevListsSize(mReferencables.getCreatureLevelledLists().getSize()),
mItemLevelledListsSize(mReferencables.getItemLevelledList().getSize()),
mLightsSize(mReferencables.getLights().getSize())
{
setSizeVariables();
}
void CSMTools::ReferenceableCheckStage::setSizeVariables()
{
mBooksSize = mReferencables.getBooks().getSize();
mActivatorsSize = mReferencables.getActivators().getSize();
mPotionsSize = mReferencables.getPotions().getSize();
mApparatiSize = mReferencables.getApparati().getSize();
mArmorsSzie = mReferencables.getArmors().getSize();
mClothingSize = mReferencables.getClothing().getSize();
mContainersSize = mReferencables.getContainers().getSize();
mCreaturesSize = mReferencables.getCreatures().getSize();
mDoorsSize = mReferencables.getDoors().getSize();
mIngredientsSize = mReferencables.getIngredients().getSize();
mCreaturesLevListsSize = mReferencables.getCreatureLevelledLists().getSize();
mItemLevelledListsSize = mReferencables.getItemLevelledList().getSize();
}
void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::string >& messages)
@ -127,8 +111,8 @@ void CSMTools::ReferenceableCheckStage::perform(int stage, std::vector< std::str
if (stage < mItemLevelledListsSize)
{
mItemLevelledListCheck(stage, mReferencables.getItemLevelledList(), messages);
return;
mItemLevelledListCheck(stage, mReferencables.getItemLevelledList(), messages);
return;
}
stage -= mItemLevelledListsSize;
@ -647,7 +631,7 @@ void CSMTools::ReferenceableCheckStage::mItemLevelledListCheck(int stage, const
}
const ESM::ItemLevList& ItemLevList = (static_cast<const CSMWorld::Record<ESM::ItemLevList>& >(baserecord)).get();
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_ItemLevelledList, CreatureLevList.mId);
CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_ItemLevelledList, ItemLevList.mId);
for (int i = 0; i < ItemLevList.mList.size(); ++i)
{

View file

@ -30,23 +30,22 @@ namespace CSMTools
void creaturesLevListCheck(int stage, const CSMWorld::RefIdDataContainer<ESM::CreatureLevList>& records, std::vector<std::string>& messages);
void mItemLevelledListCheck(int stage, const CSMWorld::RefIdDataContainer<ESM::ItemLevList>& records, std::vector<std::string>& messages);
void setSizeVariables();
const CSMWorld::RefIdData mReferencables;
//SIZES OF CONCRETE TYPES
int mBooksSize;
int mActivatorsSize;
int mPotionsSize;
int mApparatiSize;
int mArmorsSzie;
int mClothingSize;
int mContainersSize;
int mCreaturesSize;
int mDoorsSize;
int mIngredientsSize;
int mCreaturesLevListsSize;
int mItemLevelledListsSize;
const int mBooksSize;
const int mActivatorsSize;
const int mPotionsSize;
const int mApparatiSize;
const int mArmorsSzie;
const int mClothingSize;
const int mContainersSize;
const int mCreaturesSize;
const int mDoorsSize;
const int mIngredientsSize;
const int mCreaturesLevListsSize;
const int mItemLevelledListsSize;
const int mLightsSize;
};
}
#endif // REFERENCEABLECHECKSTAGE_H

View file

@ -291,3 +291,8 @@ const CSMWorld::RefIdDataContainer< ESM::ItemLevList >& CSMWorld::RefIdData::get
{
return mItemLevelledLists;
}
const CSMWorld::RefIdDataContainer< ESM::Light >& CSMWorld::RefIdData::getLights() const
{
return mLights;
}

View file

@ -233,6 +233,7 @@ namespace CSMWorld
const RefIdDataContainer<ESM::Ingredient>& getIngredients() const;
const RefIdDataContainer<ESM::CreatureLevList>& getCreatureLevelledLists() const;
const RefIdDataContainer<ESM::ItemLevList>& getItemLevelledList() const;
const RefIdDataContainer<ESM::Light>& getLights() const;
};
}