CCShakyTiles3D* CCShakyTiles3D::create(float duration, const CCSize& gridSize, int nRange, bool bShakeZ) { CCShakyTiles3D *pAction = new CCShakyTiles3D(); if (pAction) { if (pAction->initWithDuration(duration, gridSize, nRange, bShakeZ)) { pAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(pAction); } } return pAction; }
CCShakyTiles3D* CCShakyTiles3D::actionWithRange(int nRange, bool bShakeZ,const ccGridSize& gridSize, ccTime duration) { CCShakyTiles3D *pAction = new CCShakyTiles3D(); if (pAction) { if (pAction->initWithRange(nRange, bShakeZ, gridSize, duration)) { pAction->autorelease(); } else { CC_SAFE_RELEASE_NULL(pAction); } } return pAction; }
CCObject* CCShakyTiles3D::copyWithZone(CCZone *pZone) { CCZone* pNewZone = NULL; CCShakyTiles3D* pCopy = NULL; if(pZone && pZone->m_pCopyObject) { //in case of being called at sub class pCopy = (CCShakyTiles3D*)(pZone->m_pCopyObject); } else { pCopy = new CCShakyTiles3D(); pZone = pNewZone = new CCZone(pCopy); } CCTiledGrid3DAction::copyWithZone(pZone); pCopy->initWithDuration(m_fDuration, m_sGridSize, m_nRandrange, m_bShakeZ); CC_SAFE_DELETE(pNewZone); return pCopy; }