Example #1
0
bool Gypsy::checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const
{
    switch (pile->pileRole())
    {
    case PatPile::Tableau:
        return checkAddAlternateColorDescending(oldCards, newCards);
    case PatPile::Foundation:
        return checkAddSameSuitAscendingFromAce(oldCards, newCards);
    case PatPile::Stock:
    default:
        return false;
    }
}
Example #2
0
bool Fortyeight::checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const
{
    switch ( pile->pileRole() )
    {
    case PatPile::Foundation:
        return checkAddSameSuitAscendingFromAce(oldCards, newCards);
    case PatPile::Tableau:
      return canPutStore(pile, newCards);
    case PatPile::Stock:
    case PatPile::Waste:
    default:
        return false;
    }
}
Example #3
0
bool Grandf::checkAdd(const PatPile * pile, const QList<KCard*> & oldCards, const QList<KCard*> & newCards) const
{
    switch (pile->pileRole())
    {
    case PatPile::Tableau:
        if (oldCards.isEmpty())
            return newCards.first()->rank() == KCardDeck::King;
        else
            return newCards.first()->rank() == oldCards.last()->rank() - 1
                   && newCards.first()->suit() == oldCards.last()->suit();
    case PatPile::Foundation:
    default:
        return checkAddSameSuitAscendingFromAce(oldCards, newCards);
    }
}