Added the blackjack lib

This commit is contained in:
2023-06-13 09:33:43 +02:00
parent 4d41c4618e
commit ca3142a6cd
8 changed files with 385 additions and 0 deletions

52
blackjack/Card.hpp Normal file
View File

@@ -0,0 +1,52 @@
#pragma once
#include <iostream>
#include <vector>
#include <memory>
#include <random>
#include <ctime>
#include <algorithm> // for "shuffle"
#include "IterableEnum.hpp"
class Card
{
public:
ITERABLE_ENUM_BEGIN(Rank)
ACE = 1,
TWO,
THREE,
FOUR,
FIVE,
SIX,
SEVEN,
EIGHT,
NINE,
TEN,
JACK,
QUEEN,
KING
ITERABLE_ENUM_END;
ITERABLE_ENUM_BEGIN(Suit)
HEARTS,
DIAMONDS,
CLUBS,
SPADES
ITERABLE_ENUM_END;
Card(Rank rank, Suit suit);
Rank getRank() const;
Suit getSuit() const;
std::string rank_to_string() const;
std::string suit_to_string() const;
std::string to_string() const;
bool operator==(const Card &other) const;
private:
Rank rank_;
Suit suit_;
};