OpenMW
|
Mutable state of a cell. More...
#include <cellstore.hpp>
Classes | |
struct | GetCellStoreCallback |
Public Types | |
enum | State { State_Unloaded, State_Preloaded, State_Loaded } |
Public Member Functions | |
MWWorld::Ptr | moveTo (const MWWorld::Ptr &object, MWWorld::CellStore *cellToMoveTo) |
template<typename T > | |
LiveCellRefBase * | insert (const LiveCellRef< T > *ref) |
CellStore (const ESM::Cell *cell_, const MWWorld::ESMStore &store, std::vector< ESM::ESMReader > &readerList) | |
const ESM::Cell * | getCell () const |
State | getState () const |
const std::vector< std::string > & | getPreloadedIds () const |
Get Ids of objects in this cell, only valid in State_Preloaded. More... | |
bool | hasState () const |
Does this cell have state that needs to be stored in a saved game file? More... | |
bool | hasId (const std::string &id) const |
Ptr | search (const std::string &id) |
ConstPtr | searchConst (const std::string &id) const |
Ptr | searchViaActorId (int id) |
Will return an empty Ptr if cell is not loaded. More... | |
float | getWaterLevel () const |
void | setWaterLevel (float level) |
void | setFog (ESM::FogState *fog) |
ESM::FogState * | getFog () const |
int | count () const |
Return total number of references, including deleted ones. More... | |
void | load () |
Load references from content file. More... | |
void | preload () |
Build ID list from content file. More... | |
template<class Visitor > | |
bool | forEach (Visitor &visitor) |
template<class Visitor > | |
bool | forEachConst (Visitor &visitor) const |
template<class T , class Visitor > | |
bool | forEachType (Visitor &visitor) |
const CellRefList< ESM::Door > & | getReadOnlyDoors () const |
const CellRefList< ESM::Static > & | getReadOnlyStatics () const |
bool | isExterior () const |
Ptr | searchInContainer (const std::string &id) |
void | loadState (const ESM::CellState &state) |
void | saveState (ESM::CellState &state) const |
void | writeFog (ESM::ESMWriter &writer) const |
void | readFog (ESM::ESMReader &reader) |
void | writeReferences (ESM::ESMWriter &writer) const |
void | readReferences (ESM::ESMReader &reader, const std::map< int, int > &contentFileMap, GetCellStoreCallback *callback) |
void | respawn () |
Check mLastRespawn and respawn references if necessary. This is a no-op if the cell is not loaded. More... | |
bool | isPointConnected (const int start, const int end) const |
std::list< ESM::Pathgrid::Point > | aStarSearch (const int start, const int end) const |
Static Public Member Functions | |
static bool | isAccessible (const MWWorld::RefData &refdata, const MWWorld::CellRef &cref) |
Private Types | |
typedef std::map < LiveCellRefBase *, MWWorld::CellStore * > | MovedRefTracker |
Private Member Functions | |
Ptr | getCurrentPtr (MWWorld::LiveCellRefBase *ref) |
void | moveFrom (const MWWorld::Ptr &object, MWWorld::CellStore *from) |
Moves object from the given cell to this cell. More... | |
void | updateMergedRefs () |
Repopulate mMergedRefs. More... | |
template<class Visitor , class List > | |
bool | forEachImp (Visitor &visitor, List &list) |
template<class Visitor > | |
bool | forEachInternal (Visitor &visitor) |
template<class T > | |
CellRefList< T > & | get () |
void | listRefs () |
Run through references and store IDs. More... | |
void | loadRefs () |
void | loadRef (ESM::CellRef &ref, bool deleted, std::map< ESM::RefNum, std::string > &refNumToID) |
Mutable state of a cell.
|
private |
MWWorld::CellStore::CellStore | ( | const ESM::Cell * | cell_, |
const MWWorld::ESMStore & | store, | ||
std::vector< ESM::ESMReader > & | readerList | ||
) |
readerList | The readers to use for loading of the cell on-demand. |
std::list< ESM::Pathgrid::Point > MWWorld::CellStore::aStarSearch | ( | const int | start, |
const int | end | ||
) | const |
int MWWorld::CellStore::count | ( | ) | const |
Return total number of references, including deleted ones.
|
inline |
Call visitor (MWWorld::Ptr) for each reference. visitor must return a bool. Returning false will abort the iteration.
|
inline |
Call visitor (MWWorld::ConstPtr) for each reference. visitor must return a bool. Returning false will abort the iteration.
|
inlineprivate |
|
inlineprivate |
|
inline |
Call visitor (ref) for each reference of given type. visitor must return a bool. Returning false will abort the iteration.
|
private |
const ESM::Cell * MWWorld::CellStore::getCell | ( | ) | const |
|
private |
ESM::FogState * MWWorld::CellStore::getFog | ( | ) | const |
const std::vector< std::string > & MWWorld::CellStore::getPreloadedIds | ( | ) | const |
Get Ids of objects in this cell, only valid in State_Preloaded.
|
inline |
|
inline |
CellStore::State MWWorld::CellStore::getState | ( | ) | const |
float MWWorld::CellStore::getWaterLevel | ( | ) | const |
bool MWWorld::CellStore::hasId | ( | const std::string & | id | ) | const |
May return true for deleted IDs when in preload state. Will return false, if cell is unloaded.
bool MWWorld::CellStore::hasState | ( | ) | const |
Does this cell have state that needs to be stored in a saved game file?
|
inline |
Make a copy of the given object and insert it into this cell.
|
inlinestatic |
Should this reference be accessible to the outside world (i.e. to scripts / game logic)? Determined based on the deletion flags. By default, objects deleted by content files are never accessible; objects deleted by setCount(0) are still accessible if they came from a content file (needed for vanilla scripting compatibility, and the fact that objects may be "un-deleted" in the original game).
bool MWWorld::CellStore::isExterior | ( | ) | const |
|
private |
Run through references and store IDs.
void MWWorld::CellStore::load | ( | ) |
Load references from content file.
|
private |
Make case-adjustments to ref and insert it into the respective container.
Invalid ref objects are silently dropped.
|
private |
void MWWorld::CellStore::loadState | ( | const ESM::CellState & | state | ) |
|
private |
Moves object from the given cell to this cell.
MWWorld::Ptr MWWorld::CellStore::moveTo | ( | const MWWorld::Ptr & | object, |
MWWorld::CellStore * | cellToMoveTo | ||
) |
Moves object from this cell to the given cell.
void MWWorld::CellStore::preload | ( | ) |
Build ID list from content file.
void MWWorld::CellStore::readFog | ( | ESM::ESMReader & | reader | ) |
void MWWorld::CellStore::readReferences | ( | ESM::ESMReader & | reader, |
const std::map< int, int > & | contentFileMap, | ||
GetCellStoreCallback * | callback | ||
) |
callback | to use for retrieving of additional CellStore objects by ID (required for resolving moved references) |
void MWWorld::CellStore::respawn | ( | ) |
Check mLastRespawn and respawn references if necessary. This is a no-op if the cell is not loaded.
void MWWorld::CellStore::saveState | ( | ESM::CellState & | state | ) | const |
Ptr MWWorld::CellStore::search | ( | const std::string & | id | ) |
ConstPtr MWWorld::CellStore::searchConst | ( | const std::string & | id | ) | const |
Ptr MWWorld::CellStore::searchInContainer | ( | const std::string & | id | ) |
void MWWorld::CellStore::setFog | ( | ESM::FogState * | fog | ) |
void MWWorld::CellStore::setWaterLevel | ( | float | level | ) |
|
private |
Repopulate mMergedRefs.
void MWWorld::CellStore::writeFog | ( | ESM::ESMWriter & | writer | ) | const |
void MWWorld::CellStore::writeReferences | ( | ESM::ESMWriter & | writer | ) | const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |