2012-03-21 11:20:19 +00:00
|
|
|
|
|
|
|
#include "ptr.hpp"
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
|
2012-03-21 11:48:05 +00:00
|
|
|
#include "containerstore.hpp"
|
|
|
|
|
2012-03-21 11:29:07 +00:00
|
|
|
ESM::CellRef& MWWorld::Ptr::getCellRef() const
|
|
|
|
{
|
|
|
|
assert (mCellRef);
|
2012-03-21 11:48:05 +00:00
|
|
|
|
|
|
|
if (mContainerStore)
|
|
|
|
mContainerStore->flagAsModified();
|
|
|
|
|
2012-03-21 11:29:07 +00:00
|
|
|
return *mCellRef;
|
|
|
|
}
|
|
|
|
|
|
|
|
MWWorld::RefData& MWWorld::Ptr::getRefData() const
|
|
|
|
{
|
|
|
|
assert (mRefData);
|
2012-03-21 11:48:05 +00:00
|
|
|
|
|
|
|
if (mContainerStore)
|
|
|
|
mContainerStore->flagAsModified();
|
|
|
|
|
2012-03-21 11:29:07 +00:00
|
|
|
return *mRefData;
|
|
|
|
}
|
|
|
|
|
2012-03-21 11:20:19 +00:00
|
|
|
void MWWorld::Ptr::setContainerStore (ContainerStore *store)
|
|
|
|
{
|
|
|
|
assert (store);
|
|
|
|
assert (!mCell);
|
|
|
|
|
|
|
|
mContainerStore = store;
|
|
|
|
}
|
|
|
|
|
|
|
|
MWWorld::ContainerStore *MWWorld::Ptr::getContainerStore() const
|
|
|
|
{
|
|
|
|
return mContainerStore;
|
|
|
|
}
|