Blackjack
Loading...
Searching...
No Matches
suit.h
Go to the documentation of this file.
1
10#ifndef SUIT_H
11#define SUIT_H
12
13#include <cstddef>
14#include <iostream>
15
20enum class CardSuit
21{
22 club,
23 diamond,
24 heart,
25 spade,
26
28};
29
30using enum CardSuit;
31
37char getName(const CardSuit);
38
45CardSuit getSuit(std::size_t suit);
46
52int getValue(const CardSuit);
53
59std::size_t getNumSuits();
60
68std::ostream& operator<<(std::ostream& out, const CardSuit& suit);
69
70#endif
std::size_t getNumSuits()
Get the max number of suits a deck of cards can have.
Definition suit.cpp:55
int getValue(const CardSuit)
Get the numeric value of a card's suit.
Definition suit.cpp:47
CardSuit getSuit(std::size_t suit)
Given a suit, return its corresponding suit enum.
Definition suit.cpp:39
std::ostream & operator<<(std::ostream &out, const CardSuit &suit)
Overloads << to print the suit of a card.
Definition suit.cpp:61
CardSuit
The suit of a card.
Definition suit.h:21
char getName(const CardSuit)
Get the string representation of a card's suit.
Definition suit.cpp:18