Move WorldModel private functions to bottom

This is API class. A reader most likely need to know public functions first.
macos_ci
elsid 2 years ago
parent 67cf3879ac
commit df6630a15c
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -38,29 +38,6 @@ namespace MWWorld
/// \brief Cell container
class WorldModel
{
typedef std::vector<std::pair<ESM::RefId, CellStore*>> IdCache;
const MWWorld::ESMStore& mStore;
ESM::ReadersCache& mReaders;
mutable std::unordered_map<ESM::RefId, CellStore> mCells;
mutable std::map<std::string, CellStore*, Misc::StringUtils::CiComp> mInteriors;
mutable std::map<ESM::ExteriorCellLocation, CellStore*> mExteriors;
IdCache mIdCache;
std::size_t mIdCacheIndex = 0;
std::unordered_map<ESM::RefNum, Ptr> 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<int, int>& contentFileMap);
private:
using IdCache = std::vector<std::pair<ESM::RefId, CellStore*>>;
const MWWorld::ESMStore& mStore;
ESM::ReadersCache& mReaders;
mutable std::unordered_map<ESM::RefId, CellStore> mCells;
mutable std::map<std::string, CellStore*, Misc::StringUtils::CiComp> mInteriors;
mutable std::map<ESM::ExteriorCellLocation, CellStore*> mExteriors;
IdCache mIdCache;
std::size_t mIdCacheIndex = 0;
std::unordered_map<ESM::RefNum, Ptr> 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;
};
}

Loading…
Cancel
Save