1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwworld/cells.hpp

56 lines
1.4 KiB
C++
Raw Normal View History

#ifndef GAME_MWWORLD_CELLS_H
#define GAME_MWWORLD_CELLS_H
#include <map>
#include <list>
#include <string>
#include "ptr.hpp"
namespace ESM
{
class ESMReader;
}
2012-10-01 15:17:04 +00:00
namespace MWWorld
{
class ESMStore;
/// \brief Cell container
class Cells
{
2012-10-01 15:17:04 +00:00
const MWWorld::ESMStore& mStore;
std::vector<ESM::ESMReader>& mReader;
std::map<std::string, CellStore> mInteriors;
std::map<std::pair<int, int>, CellStore> mExteriors;
std::vector<std::pair<std::string, CellStore *> > mIdCache;
std::size_t mIdCacheIndex;
Cells (const Cells&);
Cells& operator= (const Cells&);
CellStore *getCellStore (const ESM::Cell *cell);
Ptr getPtrAndCache (const std::string& name, CellStore& cellStore);
public:
2013-05-15 15:54:18 +00:00
void clear();
Cells (const MWWorld::ESMStore& store, std::vector<ESM::ESMReader>& reader);
///< \todo pass the dynamic part of the ESMStore isntead (once it is written) of the whole
/// world
CellStore *getExterior (int x, int y);
CellStore *getInterior (const std::string& name);
Ptr getPtr (const std::string& name, CellStore& cellStore, bool searchInContainers = false);
///< \param searchInContainers Only affect loaded cells.
Ptr getPtr (const std::string& name);
};
}
#endif