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; } }
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; } }
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); } }