#ifndef REFERENCEABLECHECKSTAGE_H #define REFERENCEABLECHECKSTAGE_H #include #include #include "../doc/stage.hpp" #include "../world/idcollection.hpp" #include "../world/refiddata.hpp" #include #include #include #include #include namespace CSMWorld { class Resources; } namespace CSMDoc { class Messages; } namespace CSMTools { class ReferenceableCheckStage : public CSMDoc::Stage { public: ReferenceableCheckStage(const CSMWorld::RefIdData& referenceable, const CSMWorld::IdCollection& races, const CSMWorld::IdCollection& classes, const CSMWorld::IdCollection& factions, const CSMWorld::IdCollection& scripts, const CSMWorld::Resources& models, const CSMWorld::Resources& icons, const CSMWorld::IdCollection& bodyparts); void perform(int stage, CSMDoc::Messages& messages) override; int setup() override; private: // CONCRETE CHECKS void bookCheck(int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void activatorCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void potionCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void apparatusCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void armorCheck(int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void clothingCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void containerCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void creatureCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void doorCheck(int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void ingredientCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void creaturesLevListCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void itemLevelledListCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void lightCheck(int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void lockpickCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void miscCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void npcCheck(int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void weaponCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void probeCheck(int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void repairCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); void staticCheck( int stage, const CSMWorld::RefIdDataContainer& records, CSMDoc::Messages& messages); // FINAL CHECK void finalCheck(CSMDoc::Messages& messages); // Convenience functions void inventoryListCheck( const std::vector& itemList, CSMDoc::Messages& messages, const std::string& id); /// for all enchantable items. template inline void inventoryItemCheck( const Item& someItem, CSMDoc::Messages& messages, const std::string& someID, bool enchantable); /// for non-enchantable items. template inline void inventoryItemCheck(const Item& someItem, CSMDoc::Messages& messages, const std::string& someID); /// for tools with uses. template inline void toolCheck( const Tool& someTool, CSMDoc::Messages& messages, const std::string& someID, bool canbebroken); /// for tools without uses. template inline void toolCheck(const Tool& someTool, CSMDoc::Messages& messages, const std::string& someID); template inline void listCheck(const List& someList, CSMDoc::Messages& messages, const std::string& someID); template inline void scriptCheck(const Tool& someTool, CSMDoc::Messages& messages, const std::string& someID); const CSMWorld::RefIdData& mReferencables; const CSMWorld::IdCollection& mRaces; const CSMWorld::IdCollection& mClasses; const CSMWorld::IdCollection& mFactions; const CSMWorld::IdCollection& mScripts; const CSMWorld::Resources& mModels; const CSMWorld::Resources& mIcons; const CSMWorld::IdCollection& mBodyParts; bool mPlayerPresent; bool mIgnoreBaseRecords; }; } #endif // REFERENCEABLECHECKSTAGE_H