#ifndef CSM_TOOLS_TOPICINFOCHECK_HPP #define CSM_TOOLS_TOPICINFOCHECK_HPP #include #include #include #include #include #include "../world/idcollection.hpp" #include "../doc/stage.hpp" namespace CSMDoc { class Messages; } namespace CSMWorld { class InfoCollection; class RefIdData; class Resources; struct Cell; } namespace ESM { struct Class; struct Dialogue; struct Faction; struct GameSetting; struct Global; struct Race; struct Region; } namespace CSMTools { /// \brief VerifyStage: check topics class TopicInfoCheckStage : public CSMDoc::Stage { public: TopicInfoCheckStage(const CSMWorld::InfoCollection& topicInfos, const CSMWorld::IdCollection& cells, const CSMWorld::IdCollection& classes, const CSMWorld::IdCollection& factions, const CSMWorld::IdCollection& gmsts, const CSMWorld::IdCollection& globals, const CSMWorld::IdCollection& journals, const CSMWorld::IdCollection& races, const CSMWorld::IdCollection& regions, const CSMWorld::IdCollection& topics, const CSMWorld::RefIdData& referencables, const CSMWorld::Resources& soundFiles); int setup() override; ///< \return number of steps void perform(int step, CSMDoc::Messages& messages) override; ///< Messages resulting from this stage will be appended to \a messages private: const CSMWorld::InfoCollection& mTopicInfos; const CSMWorld::IdCollection& mCells; const CSMWorld::IdCollection& mClasses; const CSMWorld::IdCollection& mFactions; const CSMWorld::IdCollection& mGameSettings; const CSMWorld::IdCollection& mGlobals; const CSMWorld::IdCollection& mJournals; const CSMWorld::IdCollection& mRaces; const CSMWorld::IdCollection& mRegions; const CSMWorld::IdCollection& mTopics; const CSMWorld::RefIdData& mReferencables; const CSMWorld::Resources& mSoundFiles; std::set mCellNames; bool mIgnoreBaseRecords; // These return false when not successful and write an error bool verifyActor(const ESM::RefId& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); bool verifyCell(const std::string& cell, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); bool verifyFactionRank( const ESM::RefId& name, int rank, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); bool verifyItem(const ESM::RefId& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); bool verifySelectStruct( const ESM::DialInfo::SelectStruct& select, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); bool verifySound(const std::string& name, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); template bool verifyId(const ESM::RefId& name, const CSMWorld::IdCollection& collection, const CSMWorld::UniversalId& id, CSMDoc::Messages& messages); }; } #endif