Blackjack
|
Defines CardSuit
.
More...
#include <cstddef>
#include <iostream>
Go to the source code of this file.
Enumerations | |
enum class | CardSuit { club , diamond , heart , spade , max_suits } |
The suit of a card. More... | |
Functions | |
char | getName (const CardSuit) |
Get the string representation of a card's suit. | |
CardSuit | getSuit (std::size_t suit) |
Given a suit, return its corresponding suit enum. | |
int | getValue (const CardSuit) |
Get the numeric value of a card's suit. | |
std::size_t | getNumSuits () |
Get the max number of suits a deck of cards can have. | |
std::ostream & | operator<< (std::ostream &out, const CardSuit &suit) |
Overloads << to print the suit of a card. | |
Defines CardSuit
.
|
strong |
char getName | ( | const CardSuit | suit | ) |
Get the string representation of a card's suit.
? is returned. CardSuit getSuit | ( | std::size_t | suit | ) |
Given a suit, return its corresponding suit enum.
suit |
Type-cast suit
to CardSuit
int getValue | ( | const CardSuit | suit | ) |
Get the numeric value of a card's suit.
suit
is an enumeration; so, it's type-casted to an int
std::size_t getNumSuits | ( | ) |
Get the max number of suits a deck of cards can have.
max_suits
is an enumeration; so, it's type-casted to std::size_t
std::ostream & operator<< | ( | std::ostream & | out, |
const CardSuit & | suit | ||
) |
Overloads <<
to print the suit of a card.
out | |
suit |