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
21
class
Card
22
{
23
private
:
24
CardRank
m_rank{};
25
CardSuit
m_suit{};
26
27
public
:
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
Card
A Card is defined by its rank (see CardRank) and suit (see CardSuit).
Definition
card.h:22
Card::getCardValue
int getCardValue() const
Get the value of a Card.
Definition
card.cpp:24
Card::operator<<
friend std::ostream & operator<<(std::ostream &out, const Card &card)
Overload << to print a Card.
Definition
card.cpp:39
Card::getRank
CardRank getRank() const
Get the card's rank.
Definition
card.cpp:29
rank.h
Defines CardRank.
CardRank
CardRank
The rank of a card.
Definition
rank.h:21
CardRank::rank_ace
@ rank_ace
suit.h
Defines CardSuit.
CardSuit
CardSuit
The suit of a card.
Definition
suit.h:21
CardSuit::club
@ club
Generated by
1.9.7