Example #1
0
bool Gypsy::newCards()
{
    if ( talon->isEmpty() )
        return false;

    for ( int round = 0; round < 8; ++round )
    {
        KCard * c = talon->topCard();
        flipCardToPileAtSpeed( c, store[round], DEAL_SPEED );
        c->setZValue( c->zValue() + 8 - round );
    }

    if (talon->isEmpty())
        emit newCardsPossible(false);

    return true;
}
Example #2
0
File: spider.cpp Project: KDE/kpat
bool Spider::newCards()
{
    // The solver doesn't distinguish between dealing a new row of cards and
    // removing complete runs from the tableau. So it we're in demo mode and
    // newCards() is called, we should check to see if there are any complete
    // runs to move before dealing a new row.
    if ( isDemoActive() )
    {
        for ( int i = 0; i < 10; ++i )
        {
            if ( pileHasFullRun( stack[i] ) )
            {
                moveFullRunToLeg( stack[i] );
                return true;
            }
        }
    }

    if ( m_redeal > 4 )
        return false;

    redeals[m_redeal]->setVisible(false);
    recalculatePileLayouts();

    for ( int column = 0; column < 10; ++column )
    {
        KCard * c = redeals[m_redeal]->topCard();
        if ( !c )
            break;

        flipCardToPileAtSpeed( c, stack[column], DEAL_SPEED );
        c->setZValue( c->zValue() + 10 - column );
    }

    ++m_redeal;

    if (m_redeal > 4)
        emit newCardsPossible(false);

    return true;
}