Mutable state of a cell.
More...
#include <cellstore.hpp>
Enumerator |
---|
State_Unloaded |
|
State_Preloaded |
|
State_Loaded |
|
- Parameters
-
readerList | The readers to use for loading of the cell on-demand. |
int MWWorld::CellStore::count |
( |
| ) |
const |
Return total number of references, including deleted ones.
template<class Visitor >
bool MWWorld::CellStore::forEach |
( |
Visitor & |
visitor | ) |
|
|
inline |
Call visitor (MWWorld::Ptr) for each reference. visitor must return a bool. Returning false will abort the iteration.
- Note
- Prefer using forEachConst when possible.
-
Do not modify this cell (i.e. remove/add objects) during the forEach, doing this may result in unintended behaviour.
- Attention
- This function also lists deleted (count 0) objects!
- Returns
- Iteration completed?
template<class Visitor >
bool MWWorld::CellStore::forEachConst |
( |
Visitor & |
visitor | ) |
const |
|
inline |
Call visitor (MWWorld::ConstPtr) for each reference. visitor must return a bool. Returning false will abort the iteration.
- Note
- Do not modify this cell (i.e. remove/add objects) during the forEach, doing this may result in unintended behaviour.
- Attention
- This function also lists deleted (count 0) objects!
- Returns
- Iteration completed?
template<class Visitor , class List >
bool MWWorld::CellStore::forEachImp |
( |
Visitor & |
visitor, |
|
|
List & |
list |
|
) |
| |
|
inlineprivate |
template<class Visitor >
bool MWWorld::CellStore::forEachInternal |
( |
Visitor & |
visitor | ) |
|
|
inlineprivate |
template<class T , class Visitor >
bool MWWorld::CellStore::forEachType |
( |
Visitor & |
visitor | ) |
|
|
inline |
Call visitor (ref) for each reference of given type. visitor must return a bool. Returning false will abort the iteration.
- Note
- Do not modify this cell (i.e. remove/add objects) during the forEach, doing this may result in unintended behaviour.
- Attention
- This function also lists deleted (count 0) objects!
- Returns
- Iteration completed?
- Note
- If you get a linker error here, this means the given type can not be stored in a cell. The supported types are defined at the bottom of this file.
const ESM::Cell * MWWorld::CellStore::getCell |
( |
| ) |
const |
const std::vector< std::string > & MWWorld::CellStore::getPreloadedIds |
( |
| ) |
const |
Get Ids of objects in this cell, only valid in State_Preloaded.
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.
- Note
- Will not account for moved references which may exist in Loaded state. Use search() instead if the cell is loaded.
bool MWWorld::CellStore::hasState |
( |
| ) |
const |
Does this cell have state that needs to be stored in a saved game file?
Make a copy of the given object and insert it into this cell.
- Note
- If you get a linker error here, this means the given type can not be inserted into a cell. The supported types are defined at the bottom of this file.
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 |
void MWWorld::CellStore::listRefs |
( |
| ) |
|
|
private |
Run through references and store IDs.
void MWWorld::CellStore::load |
( |
| ) |
|
Load references from content file.
Make case-adjustments to ref and insert it into the respective container.
Invalid ref objects are silently dropped.
void MWWorld::CellStore::loadRefs |
( |
| ) |
|
|
private |
Moves object from the given cell to this cell.
Moves object from this cell to the given cell.
- Note
- automatically updates given cell by calling cellToMoveTo->moveFrom(...)
-
throws exception if cellToMoveTo == this
- Returns
- updated MWWorld::Ptr with the new CellStore pointer set.
void MWWorld::CellStore::preload |
( |
| ) |
|
Build ID list from content file.
- Parameters
-
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::rest |
( |
| ) |
|
Ptr MWWorld::CellStore::search |
( |
const std::string & |
id | ) |
|
Will return an empty Ptr if cell is not loaded. Does not check references in containers.
- Note
- Triggers CellStore hasState flag.
ConstPtr MWWorld::CellStore::searchConst |
( |
const std::string & |
id | ) |
const |
Will return an empty Ptr if cell is not loaded. Does not check references in containers.
- Note
- Does not trigger CellStore hasState flag.
Ptr MWWorld::CellStore::searchInContainer |
( |
const std::string & |
id | ) |
|
Ptr MWWorld::CellStore::searchViaActorId |
( |
int |
id | ) |
|
Will return an empty Ptr if cell is not loaded.
- Note
- Takes ownership of the pointer
void MWWorld::CellStore::setWaterLevel |
( |
float |
level | ) |
|
void MWWorld::CellStore::updateMergedRefs |
( |
| ) |
|
|
private |
void MWWorld::CellStore::writeReferences |
( |
ESM::ESMWriter & |
writer | ) |
const |
bool MWWorld::CellStore::mHasState |
|
private |
std::vector<std::string> MWWorld::CellStore::mIds |
|
private |
State MWWorld::CellStore::mState |
|
private |
float MWWorld::CellStore::mWaterLevel |
|
private |
The documentation for this class was generated from the following files:
- /home/travis/build/elsid/openmw/apps/openmw/mwworld/cellstore.hpp
- /home/travis/build/elsid/openmw/apps/openmw/mwworld/cellstore.cpp