#ifndef CSM_WOLRD_INFOCOLLECTION_H #define CSM_WOLRD_INFOCOLLECTION_H #include #include #include #include #include "collection.hpp" #include "info.hpp" namespace ESM { struct Dialogue; class ESMReader; template class InfoOrder; } namespace CSMWorld { using InfosRecordPtrByTopic = std::unordered_map*>>; struct OrderedInfo { ESM::RefId mId; ESM::RefId mNext; ESM::RefId mPrev; explicit OrderedInfo(const Info& info) : mId(info.mOriginalId) , mNext(info.mNext) , mPrev(info.mPrev) { } }; using InfoOrder = ESM::InfoOrder; using InfoOrderByTopic = std::map>; class InfoCollection : public Collection { private: void load(const Info& value, bool base); public: void load(ESM::ESMReader& reader, bool base, const ESM::Dialogue& dialogue, InfoOrderByTopic& infoOrder); void sort(const InfoOrderByTopic& infoOrders); InfosRecordPtrByTopic getInfosByTopic() const; int getAppendIndex(const ESM::RefId& id, UniversalId::Type type = UniversalId::Type_None) const override; bool reorderRows(int baseIndex, const std::vector& newOrder) override; }; } #endif