OpenMW
apps/openmw/mwworld/cells.hpp
Go to the documentation of this file.
00001 #ifndef GAME_MWWORLD_CELLS_H
00002 #define GAME_MWWORLD_CELLS_H
00003 
00004 #include <map>
00005 #include <list>
00006 #include <string>
00007 
00008 #include "ptr.hpp"
00009 
00010 namespace ESM
00011 {
00012     class ESMReader;
00013 }
00014 
00015 namespace MWWorld
00016 {
00017     class ESMStore;
00018 
00020     class Cells
00021     {
00022             const MWWorld::ESMStore& mStore;
00023             std::vector<ESM::ESMReader>& mReader;
00024             std::map<std::string, CellStore> mInteriors;
00025             std::map<std::pair<int, int>, CellStore> mExteriors;
00026             std::vector<std::pair<std::string, CellStore *> > mIdCache;
00027             std::size_t mIdCacheIndex;
00028 
00029             Cells (const Cells&);
00030             Cells& operator= (const Cells&);
00031 
00032             CellStore *getCellStore (const ESM::Cell *cell);
00033 
00034             Ptr getPtrAndCache (const std::string& name, CellStore& cellStore);
00035 
00036         public:
00037 
00038             void clear();
00039 
00040             Cells (const MWWorld::ESMStore& store, std::vector<ESM::ESMReader>& reader);
00043 
00044             CellStore *getExterior (int x, int y);
00045 
00046             CellStore *getInterior (const std::string& name);
00047 
00048             Ptr getPtr (const std::string& name, CellStore& cellStore, bool searchInContainers = false);
00051 
00053             Ptr getPtr (const std::string& name);
00054 
00058             void getExteriorPtrs (const std::string& name, std::vector<MWWorld::Ptr>& out);
00059     };
00060 }
00061 
00062 #endif