-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcard.h
54 lines (46 loc) · 901 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
47
48
49
50
51
52
53
54
/**
* @file card.h
* @author DSN
* @brief Defines a \c Card
* @version 0.3
* @date 2023-08-19
*
*/
#ifndef CARD_H
#define CARD_H
#include "rank.h"
#include "suit.h"
#include <iostream>
/**
* @brief A \c Card is defined by its rank (see \c CardRank) and suit (see \c CardSuit).
*
*/
class Card
{
private:
CardRank m_rank{};
CardSuit m_suit{};
public:
Card(CardRank rank = rank_ace, CardSuit suit = club);
/**
* @brief Get the value of a \c Card
*
* @return int
*/
int getCardValue() const;
/**
* @brief Get the card's rank
*
* @return CardRank
*/
CardRank getRank() const;
/**
* @brief Overload \c << to print a \c Card
*
* @param out
* @param card
* @return std::ostream&
*/
friend std::ostream& operator<<(std::ostream& out, const Card& card);
};
#endif