diff options
Diffstat (limited to 'card.cpp')
-rw-r--r-- | card.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -73,6 +73,32 @@ void Card::rankCard(void) } } +enum Suit Card::getSuit(void) +{ + enum Suit whatSuit = Undef; + char c = type[1]; + + switch (c) + { + case 'C': + whatSuit = Clubs; + break; + case 'D': + whatSuit = Diamond; + break; + case 'H': + whatSuit = Hearts; + break; + case 'S': + whatSuit = Spades; + break; + default: + cout << "could not determine the suit of the card" << endl; + } + + return whatSuit; +} + void Card::sortCards(Card **cards) { /* bubble sort */ |