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