1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 12:42:11 +00:00
OpenMW/apps/openmw/mwworld/livecellref.cpp
2014-01-30 11:50:13 +01:00

29 lines
699 B
C++

#include "livecellref.hpp"
#include <components/esm/objectstate.hpp>
#include "ptr.hpp"
#include "class.hpp"
void MWWorld::LiveCellRefBase::loadImp (const ESM::ObjectState& state)
{
mRef = state.mRef;
mData = RefData (state);
Ptr ptr (this);
mClass->readAdditionalState (ptr, state);
}
void MWWorld::LiveCellRefBase::saveImp (ESM::ObjectState& state) const
{
state.mRef = mRef;
mData.write (state);
/// \todo get rid of this cast once const-correct Ptr are available
Ptr ptr (const_cast<LiveCellRefBase *> (this));
mClass->writeAdditionalState (ptr, state);
}
bool MWWorld::LiveCellRefBase::checkStateImp (const ESM::ObjectState& state)
{
return true;
}