-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcard.h
46 lines (35 loc) · 1022 Bytes
/
card.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Definition of a card class
//
// Contains very basic card structure.
// authors: Jonathan, Cathal, Nidhu
// date: 01.11.2014
//////////////////////////////////////////////////////////////////////
#ifndef CARD_H
#define CARD_H
#include <string>
using std::string;
class card
{
public:
typedef enum {Clubs, Spades, Hearts, Diamonds} Suit;
typedef enum {Ace, Two, Three, Four, Five, Six,
Seven, Eight, Nine, Ten, Jack, Queen, King} Rank;
//default constructor required for custom onject array
card();
// Create card of suit and rank
card(Suit suit, Rank rank);
// Accessors
inline Rank getCardRank() {return rank;}
inline Suit getCardSuit() {return suit;}
// Mutators
inline void setCardRank(Rank rank) {rank = rank;}
inline void setCardSuit(Suit suit) {suit = suit;}
// Method to get ranks and suits as strings.
string getRankAsString();
string getSuitAsString();
private:
Rank rank;
Suit suit;
card *ptr;
};
#endif