@ -18,44 +18,40 @@ namespace MWWorld
typedef MWWorld : : CellStore CellStore ;
///< \deprecated
MWWorld : : LiveCellRefBase * mPtr ;
ESM : : CellRef * mCellRef ;
RefData * mRefData ;
MWWorld : : LiveCellRefBase * mRef ;
CellStore * mCell ;
ContainerStore * mContainerStore ;
public :
Ptr ( ) : m Ptr ( 0 ) , mCell Ref ( 0 ) , mRefData ( 0 ) , mCell ( 0 ) , mContainerStore ( 0 ) { }
Ptr ( ) : m Ref( 0 ) , mCell ( 0 ) , mContainerStore ( 0 ) { }
bool isEmpty ( ) const
{
return m Ptr = = 0 ;
return m Ref = = 0 ;
}
const std : : string & getTypeName ( ) const
{
return m Ptr ? mPtr - > mTypeName : sEmptyString ;
return m Ref ? mRef - > mTypeName : sEmptyString ;
}
Ptr ( MWWorld : : LiveCellRefBase * liveCellRef , CellStore * cell )
: mContainerStore ( 0 )
{
mPtr = liveCellRef ;
mCellRef = & liveCellRef - > mRef ;
mRefData = & liveCellRef - > mData ;
mRef = liveCellRef ;
mCell = cell ;
}
template < typename T >
MWWorld : : LiveCellRef < T > * get ( ) const
{
if ( m Ptr & & mPtr - > mTypeName = = typeid ( T ) . name ( ) )
return static_cast < MWWorld : : LiveCellRef < T > * > ( m Ptr ) ;
if ( m Ref & & mRef - > mTypeName = = typeid ( T ) . name ( ) )
return static_cast < MWWorld : : LiveCellRef < T > * > ( m Ref ) ;
std : : stringstream str ;
str < < " Bad LiveCellRef cast to " < < typeid ( T ) . name ( ) < < " from " ;
if ( m Ptr ! = 0 ) str < < mPtr - > mTypeName ;
if ( m Ref ! = 0 ) str < < mRef - > mTypeName ;
else str < < " an empty object " ;
throw std : : runtime_error ( str . str ( ) ) ;
@ -85,7 +81,7 @@ namespace MWWorld
inline bool operator = = ( const Ptr & left , const Ptr & right )
{
return left . mRef Data = = right . mRef Data ;
return left . mRef = = right . mRef ;
}
inline bool operator ! = ( const Ptr & left , const Ptr & right )
@ -95,7 +91,7 @@ namespace MWWorld
inline bool operator < ( const Ptr & left , const Ptr & right )
{
return left . mRef Data < right . mRef Data ;
return left . mRef < right . mRef ;
}
inline bool operator > = ( const Ptr & left , const Ptr & right )