Blackjack
Loading...
Searching...
No Matches
rank.h
Go to the documentation of this file.
1
10#ifndef RANK_H
11#define RANK_H
12
13#include <cstddef>
14#include <iostream>
15
20enum class CardRank
21{
22 rank_2,
23 rank_3,
24 rank_4,
25 rank_5,
26 rank_6,
27 rank_7,
28 rank_8,
29 rank_9,
30 rank_10,
35
37};
38
39using enum CardRank;
40
46char getName(const CardRank rank);
47
54CardRank getRank(std::size_t rank);
55
61int getValue(const CardRank rank);
62
68std::size_t getNumRanks();
69
77std::ostream& operator<<(std::ostream& out, const CardRank& rank);
78
79#endif
CardRank getRank(std::size_t rank)
Given an integer, get the corresponding rank enum.
Definition rank.cpp:60
char getName(const CardRank rank)
Get a character representation of a card's rank.
Definition rank.cpp:21
std::ostream & operator<<(std::ostream &out, const CardRank &rank)
Overloads << to print the rank of a card.
Definition rank.cpp:108
CardRank
The rank of a card.
Definition rank.h:21
std::size_t getNumRanks()
An auxiliary function that defines an upper bound on the number of ranks a deck of cards can have.
Definition rank.cpp:102
int getValue(const CardRank rank)
Get the numeric value of a card's rank.
Definition rank.cpp:73