From df6630a15c96e30ecded42106d8de4411fc61329 Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 26 May 2023 19:09:54 +0200 Subject: [PATCH] Move WorldModel private functions to bottom This is API class. A reader most likely need to know public functions first. --- apps/openmw/mwworld/worldmodel.hpp | 47 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/apps/openmw/mwworld/worldmodel.hpp b/apps/openmw/mwworld/worldmodel.hpp index 300adbe2db..0cba5e526a 100644 --- a/apps/openmw/mwworld/worldmodel.hpp +++ b/apps/openmw/mwworld/worldmodel.hpp @@ -38,29 +38,6 @@ namespace MWWorld /// \brief Cell container class WorldModel { - typedef std::vector> IdCache; - const MWWorld::ESMStore& mStore; - ESM::ReadersCache& mReaders; - mutable std::unordered_map mCells; - mutable std::map mInteriors; - - mutable std::map mExteriors; - IdCache mIdCache; - std::size_t mIdCacheIndex = 0; - std::unordered_map mPtrIndex; - std::size_t mPtrIndexUpdateCounter = 0; - ESM::RefNum mLastGeneratedRefnum; - - CellStore& getOrInsertCellStore(const ESM::Cell& cell); - - CellStore& insertCellStore(const ESM::Cell& cell); - - CellStore* getInteriorOrNull(std::string_view name); - - Ptr getPtrAndCache(const ESM::RefId& name, CellStore& cellStore); - - void writeCell(ESM::ESMWriter& writer, CellStore& cell) const; - public: explicit WorldModel(const MWWorld::ESMStore& store, ESM::ReadersCache& reader); @@ -111,6 +88,30 @@ namespace MWWorld void write(ESM::ESMWriter& writer, Loading::Listener& progress) const; bool readRecord(ESM::ESMReader& reader, uint32_t type, const std::map& contentFileMap); + + private: + using IdCache = std::vector>; + + const MWWorld::ESMStore& mStore; + ESM::ReadersCache& mReaders; + mutable std::unordered_map mCells; + mutable std::map mInteriors; + mutable std::map mExteriors; + IdCache mIdCache; + std::size_t mIdCacheIndex = 0; + std::unordered_map mPtrIndex; + std::size_t mPtrIndexUpdateCounter = 0; + ESM::RefNum mLastGeneratedRefnum; + + CellStore& getOrInsertCellStore(const ESM::Cell& cell); + + CellStore& insertCellStore(const ESM::Cell& cell); + + CellStore* getInteriorOrNull(std::string_view name); + + Ptr getPtrAndCache(const ESM::RefId& name, CellStore& cellStore); + + void writeCell(ESM::ESMWriter& writer, CellStore& cell) const; }; }