diff --git a/apps/openmw/mwworld/esmstore.cpp b/apps/openmw/mwworld/esmstore.cpp index 23c150c090..38dd2c4190 100644 --- a/apps/openmw/mwworld/esmstore.cpp +++ b/apps/openmw/mwworld/esmstore.cpp @@ -215,8 +215,8 @@ namespace MWWorld Store mSkills; Store mAttributes; - std::map mRecNameToStore; - std::unordered_map mStoreToRecName; + std::map mRecNameToStore; + std::unordered_map mStoreToRecName; // Lookup of all IDs. Makes looking up references faster. Just // maps the id name to the record type. @@ -291,7 +291,7 @@ namespace MWWorld template static void createStore(ESMStore& stores) { - if constexpr (std::is_convertible*, StoreBase*>::value) + if constexpr (std::is_convertible*, DynamicStore*>::value) { int storeIndex = SRecordType::sStoreIndex; stores.mStores[storeIndex] = std::make_unique>(); @@ -307,7 +307,7 @@ namespace MWWorld { for (const auto& recordStorePair : mRecNameToStore) { - const StoreBase* storePtr = recordStorePair.second; + const DynamicStore* storePtr = recordStorePair.second; mStoreToRecName[storePtr] = recordStorePair.first; } } @@ -481,7 +481,7 @@ void ESMStore::setUp() { mStoreImp->mIds.clear(); - std::map::iterator storeIt = mStoreImp->mRecNameToStore.begin(); + std::map::iterator storeIt = mStoreImp->mRecNameToStore.begin(); for (; storeIt != mStoreImp->mRecNameToStore.end(); ++storeIt) { storeIt->second->setUp(); diff --git a/apps/openmw/mwworld/esmstore.hpp b/apps/openmw/mwworld/esmstore.hpp index 276b004a89..a097ac6a7f 100644 --- a/apps/openmw/mwworld/esmstore.hpp +++ b/apps/openmw/mwworld/esmstore.hpp @@ -38,7 +38,7 @@ namespace MWWorld std::unordered_map mRefCount; - std::vector> mStores; + std::vector> mStores; unsigned int mDynamicCount; @@ -65,7 +65,7 @@ namespace MWWorld ESM::LuaScriptsCfg getLuaScriptsCfg() const; /// \todo replace with SharedIterator - typedef std::vector>::const_iterator iterator; + typedef std::vector>::const_iterator iterator; iterator begin() const { return mStores.begin(); @@ -130,7 +130,7 @@ namespace MWWorld std::pair, bool> getSpellList(const std::string& id) const; }; - //Special cases these aren't StoreBase, but IndexedStore + //Special cases these aren't DynamicStore, but IndexedStore template <> const Store& ESMStore::get() const; template <> Store& ESMStore::getWritable(); diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index 214d3b3a96..2501881803 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -43,10 +43,12 @@ namespace MWWorld RecordId(const std::string &id = {}, bool isDeleted = false); }; - class StoreBase + class StoreBase {}; //Empty interface to be parent of all store types + + class DynamicStore : StoreBase { public: - virtual ~StoreBase() {} + virtual ~DynamicStore() {} virtual void setUp() {} @@ -67,7 +69,7 @@ namespace MWWorld }; template - class IndexedStore + class IndexedStore : StoreBase { protected: typedef typename std::map Static; @@ -161,7 +163,7 @@ namespace MWWorld class ESMStore; template - class Store : public StoreBase + class Store : public DynamicStore { typedef std::unordered_map Static; Static mStatic; @@ -220,7 +222,7 @@ namespace MWWorld }; template <> - class Store : public StoreBase + class Store : public DynamicStore { // For multiple ESM/ESP files we need one list per file. typedef std::vector LandTextureList; @@ -248,7 +250,7 @@ namespace MWWorld }; template <> - class Store : public StoreBase + class Store : public DynamicStore { struct SpatialComparator { @@ -291,7 +293,7 @@ namespace MWWorld }; template <> - class Store : public StoreBase + class Store : public DynamicStore { struct DynamicExtCmp { @@ -366,7 +368,7 @@ namespace MWWorld }; template <> - class Store : public StoreBase + class Store : public DynamicStore { private: typedef std::unordered_map Interior; @@ -433,7 +435,7 @@ namespace MWWorld }; template <> - class Store : public StoreBase + class Store : public DynamicStore { std::map mStatic; @@ -459,7 +461,7 @@ namespace MWWorld }; template <> - class Store : public StoreBase + class Store : public DynamicStore { typedef std::unordered_map Static; Static mStatic;