Blackjack
Loading...
Searching...
No Matches
card.h
Go to the documentation of this file.
1
10#ifndef CARD_H
11#define CARD_H
12
13#include "rank.h"
14#include "suit.h"
15#include <iostream>
16
21class Card
22{
23private:
24 CardRank m_rank{};
25 CardSuit m_suit{};
26
27public:
28 Card(CardRank rank = rank_ace, CardSuit suit = club);
29
35 int getCardValue() const;
36
42 CardRank getRank() const;
43
51 friend std::ostream& operator<<(std::ostream& out, const Card& card);
52};
53
54#endif
A Card is defined by its rank (see CardRank) and suit (see CardSuit).
Definition card.h:22
int getCardValue() const
Get the value of a Card.
Definition card.cpp:24
friend std::ostream & operator<<(std::ostream &out, const Card &card)
Overload << to print a Card.
Definition card.cpp:39
CardRank getRank() const
Get the card's rank.
Definition card.cpp:29
Defines CardRank.
CardRank
The rank of a card.
Definition rank.h:21
Defines CardSuit.
CardSuit
The suit of a card.
Definition suit.h:21