Exemplo n.º 1
0
Card *Fortyeight::newCards()
{
    if (Deck::deck()->isEmpty() && lastdeal)
        return 0;

    if (pile->top() && pile->top()->animated())
        return pile->top();

    if (Deck::deck()->isEmpty())
    {
        lastdeal = true;
        while (!pile->isEmpty())
        {
            Card *c = pile->at(pile->cardsLeft()-1);
            c->stopAnimation();
            Deck::deck()->add(c, true);
        }
    }

    Card *c = Deck::deck()->nextCard();
    pile->add(c, true);
    c->stopAnimation();
    qreal x = c->realX();
    qreal y = c->realY();
    c->setPos( Deck::deck()->pos() );
    c->flipTo(x, y, DURATION_FLIP );

    takeState();
    considerGameStarted();
    if ( Deck::deck()->isEmpty() && lastdeal )
        emit newCardsPossible( false );

    return c;
}
Exemplo n.º 2
0
Card *Gypsy::newCards()
{
    if (Deck::deck()->isEmpty())
        return 0;

    unmarkAll();
    dealRow(true);
    takeState();
    considerGameStarted();
    if (Deck::deck()->isEmpty())
        emit newCardsPossible(false);

    return store[0]->top();
}
Exemplo n.º 3
0
bool Grandf::newCards()
{
    if ( numberOfDeals >= 3 )
        return false;

    // NOTE: This is not quite correct. The piles should be turned face down
    //       (i.e. partially reversed) during collection.
    QList<KCard*> collectedCards;
    for ( int pos = 6; pos >= 0; --pos )
    {
        collectedCards << store[pos]->cards();
        store[pos]->clear();
    }
    deal( collectedCards );
    takeState();

    numberOfDeals++;

    if (numberOfDeals == 3)
        emit newCardsPossible(false);

    return true;
}
Exemplo n.º 4
0
void Gypsy::deal() {
    dealRow(false);
    dealRow(false);
    dealRow(true);
    takeState();
}