CCCallFuncN* CCCallFuncN::create ( KDint nHandler )
{
	CCCallFuncN*  pRet = new CCCallFuncN ( );

	if ( pRet ) 
	{
		pRet->m_nScriptHandler = nHandler;
		pRet->autorelease ( );
	}
	else 
	{
		CC_SAFE_DELETE ( pRet );
	}
	return pRet;
}
CCCallFuncN* CCCallFuncN::create ( CCObject* pSelectorTarget, SEL_CallFuncN pSelector )
{
	CCCallFuncN*  pRet = new CCCallFuncN ( );
	
	if ( pRet && pRet->initWithTarget ( pSelectorTarget, pSelector ) )
	{
		pRet->autorelease ( );
	}
	else
	{
		CC_SAFE_DELETE ( pRet );
	}
	
	return pRet;
}
示例#3
0
	CCObject * CCCallFuncN::copyWithZone(CCZone* zone)
	{
		CCZone* pNewZone = NULL;
		CCCallFuncN* pRet = NULL;
		if(zone && zone->m_pCopyObject) //in case of being called at sub class
			pRet = (CCCallFuncN*)(zone->m_pCopyObject);
		else
		{
			pRet = new CCCallFuncN();
			zone = pNewZone = new CCZone(pRet);
		}
		CCCallFunc::copyWithZone(zone);
		pRet->initWithTarget(m_pSelectorTarget, m_pCallFuncN);
		CC_SAFE_DELETE(pNewZone);
		return pRet;
	}
CCObject* CCCallFuncN::copyWithZone ( CCZone* pZone )
{
	CCZone*   pNewZone = KD_NULL;
	CCCallFuncN*  pRet = KD_NULL;

	if ( pZone && pZone->m_pCopyObject ) 
	{
		pRet = (CCCallFuncN*) pZone->m_pCopyObject;
	}
	else
	{
		pRet = new CCCallFuncN ( );
		pZone = pNewZone = new CCZone ( pRet );
	}
	
	CCCallFunc::copyWithZone ( pZone );
	
	pRet->initWithTarget ( m_pSelectorTarget, m_pCallFuncN );
	
	CC_SAFE_DELETE ( pNewZone );
	
	return pRet;
}