//virtual
BcBool CsSerialiserPackageObjectCodec::shouldSerialiseContents( 
	void* InData, 
	const ReClass* InType )
{
	BcBool RetVal = BcFalse;
	if( Package_ != nullptr )
	{
		const ReClass* InClass = static_cast< const ReClass* >( InType );

		if( InClass->hasBaseClass( ReObject::StaticGetClass() ) )
		{
			CsResource* Resource = reinterpret_cast< CsResource* >( InData );
			ReObject* ResourceRootOwner = Resource->getRootOwner();
			if( Package_ == ResourceRootOwner )
			{
				RetVal = BcTrue;
			}
		}
		else
		{
			RetVal = BcTrue;
		}
	}
	else
	{
		RetVal = BcTrue;
	}

	return RetVal;
}
//virtual
std::string CsSerialiserPackageObjectCodec::serialiseAsStringRef( 
	void* InData, 
	const ReClass* InType )
{
	std::string RetVal;

	if( Package_ != nullptr )
	{
		const ReClass* InClass = static_cast< const ReClass* >( InType );

		// Check if it's a resource.
		if( InClass->hasBaseClass( ReObject::StaticGetClass() ) )
		{
			CsResource* Resource = reinterpret_cast< CsResource* >( InData );
			ReObject* ResourceRootOwner = Resource->getRootOwner();
			if( ResourceRootOwner != nullptr )
			{
				BcChar OutChars[ 128 ];
				BcSPrintf( OutChars, "$(%s:%s.%s)",  
					(*Resource->getClass()->getName()).c_str(), 
					(*ResourceRootOwner->getName()).c_str(),
					(*Resource->getName()).c_str() );
				RetVal = OutChars;
			}
		}
	}

	if( RetVal.empty() )
	{
		// Default formatting.
		BcChar OutChars[ 128 ];
		BcSPrintf( OutChars, "$(%s:%s.%llu)",   
			(*InType->getName()).c_str(),
			( "this" ),
			( (unsigned long long)InData ) );
	}

	return RetVal;
}