-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard.h
More file actions
35 lines (25 loc) · 734 Bytes
/
Card.h
File metadata and controls
35 lines (25 loc) · 734 Bytes
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
#ifndef CARD_H
#define CARD_H
#include <iostream>
class Card {
public:
// types for rank and suit
enum Suit {SPADES, HEARTS, CLUBS, DIAMONDS};
enum Rank {TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN,
JACK, QUEEN, KING, ACE};
//EFFECTS: initializes Card to Two of Spades
Card();
//EFFECTS: initializes Card with rank_in and suit_in
Card(Rank rank_in, Suit suit_in);
//EFFECTS: returns rank
Rank get_rank() const;
//EFFECTS: returns suit
Suit get_suit() const;
private:
Rank rank; // rank of this card
Suit suit; // suit of this card
};
//EFFECTS: Writes the Card to the stream
// for example "Two of Spades"
std::ostream& operator<< (std::ostream& os, const Card& c);
#endif