1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
openmw-tes3mp/apps/openmw/mwworld/ptr.cpp
scrawl 67bd6cd708 Remove empty line at the beginning of files
git ls-files -z | xargs -0 sed -i '1{/^$/d}'
2015-08-18 23:06:12 +02:00

54 lines
982 B
C++

#include "ptr.hpp"
#include <cassert>
#include "containerstore.hpp"
#include "class.hpp"
#include "livecellref.hpp"
const std::string& MWWorld::Ptr::getTypeName() const
{
if(mRef != 0)
return mRef->mClass->getTypeName();
throw std::runtime_error("Can't get type name from an empty object.");
}
MWWorld::LiveCellRefBase *MWWorld::Ptr::getBase() const
{
if (!mRef)
throw std::runtime_error ("Can't access cell ref pointed to by null Ptr");
return mRef;
}
MWWorld::CellRef& MWWorld::Ptr::getCellRef() const
{
assert(mRef);
return mRef->mRef;
}
MWWorld::RefData& MWWorld::Ptr::getRefData() const
{
assert(mRef);
return mRef->mData;
}
void MWWorld::Ptr::setContainerStore (ContainerStore *store)
{
assert (store);
assert (!mCell);
mContainerStore = store;
}
MWWorld::ContainerStore *MWWorld::Ptr::getContainerStore() const
{
return mContainerStore;
}
MWWorld::Ptr::operator const void *()
{
return mRef;
}