summaryrefslogtreecommitdiffstats
path: root/card.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'card.cpp')
-rw-r--r--card.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/card.cpp b/card.cpp
index 36704b8..3c4854d 100644
--- a/card.cpp
+++ b/card.cpp
@@ -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 */