Exemplo n.º 1
0
CCShuffleTiles* CCShuffleTiles::create(float duration, const CCSize& gridSize)
{
    CCShuffleTiles *pAction = new CCShuffleTiles();

    if (pAction)
    {
        if (pAction->initWithDuration(duration, gridSize))
        {
            pAction->autorelease();
        }
        else
        {
            CC_SAFE_RELEASE_NULL(pAction);
        }
    }

    return pAction;    
}
CCShuffleTiles* CCShuffleTiles::create(float duration, const CCSize& gridSize, unsigned int seed)
{
    CCShuffleTiles *pAction = new CCShuffleTiles();

    if (pAction)
    {
        if (pAction->initWithDuration(duration, gridSize, seed))
        {
            CC_SAFE_AUTORELEASE(pAction);
        }
        else
        {
            CC_SAFE_RELEASE_NULL(pAction);
        }
    }

    return pAction;
}
Exemplo n.º 3
0
CCObject* CCShuffleTiles::copyWithZone(CCZone *pZone)
{
    CCZone* pNewZone = NULL;
    CCShuffleTiles* pCopy = NULL;
    if(pZone && pZone->m_pCopyObject)
    {
        pCopy = (CCShuffleTiles*)(pZone->m_pCopyObject);
    }
    else
    {
        pCopy = new CCShuffleTiles();
        pZone = pNewZone = new CCZone(pCopy);
    }

    CCTiledGrid3DAction::copyWithZone(pZone);

    pCopy->initWithDuration(m_fDuration, m_sGridSize);

    CC_SAFE_DELETE(pNewZone);
    return pCopy;
}