Exemplo n.º 1
0
bool PlayingCards::HasCard(const Card &cCardInQuestion) const
{
    for (const Card &cCard : m_vCards)
    {
        if (cCard.Suit() == cCardInQuestion.Suit() &&
            cCard.Rank() == cCardInQuestion.Rank())
        {
            return true;
        }
    }

    return false;
}
Exemplo n.º 2
0
int	Hand::ConvertCardToPokerEvalCard(const Card& card) const
{
	int rank, suit;

	// We must convert our hand from our format (8-bit):
	// | 7  6  5  4   3  2  1  0 |
	// |    rank    |    suit    |
	//
	// to the poker-eval format (16-bit)
	//        (rank*4)+suit
	//
	rank = card.Rank()-2;
	suit = card.Suit() == Card::CLUBS ? StdDeck_Suit_CLUBS :
			   card.Suit() == Card::DIAMONDS ? StdDeck_Suit_DIAMONDS :
			   card.Suit() == Card::HEARTS ? StdDeck_Suit_HEARTS :
			   card.Suit() == Card::SPADES ? StdDeck_Suit_SPADES : 0;

	return (StdDeck_MAKE_CARD(rank, suit));
}
Exemplo n.º 3
0
Card PlayingCards::RemoveCard(const Card &cCard)
{
    return RemoveCard(cCard.Rank(), cCard.Suit());
}