Repository navigation
Expand file tree
/
Copy pathengine.hpp
More file actions
executable file
·72 lines (60 loc) · 1.76 KB
/
Copy pathengine.hpp
File metadata and controls
executable file
·72 lines (60 loc) · 1.76 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef ENGINE_HEADER
#define ENGINE_HEADER
#include <string_view>
#include <vector>
#include <array>
struct Card {
const std::string_view name;
const int cardValue;
};
constexpr std::array<Card, 13> cards {
{
{"Ace", 11},
{"Two", 2},
{"Three", 3},
{"Four", 4},
{"Five", 5},
{"Six", 6},
{"Seven", 7},
{"Eight", 8},
{"Nine", 9},
{"Ten", 10},
{"Jack", 10},
{"Queen", 10},
{"King", 10}
}
};
struct WindowConfig {
int BoardwindowPositionY{};
int BoardwindowPositionX{};
int verticallyCentered{};
};
namespace UI {
struct StaticText {
static constexpr std::string_view dealer {"Dealer"};
static constexpr std::string_view player {"Player"};
static constexpr std::string_view score {"Score: "};
};
struct EventMessages {
static constexpr std::string_view bust {"BUST!"};
static constexpr std::string_view win {"You win!"};
static constexpr std::string_view lose {"You lose!"};
static constexpr std::string_view push {"Push!"};
static constexpr std::string_view dealerStands {"Dealer stands"};
static constexpr std::string_view dealerBust {"Dealer busted!"};
static constexpr std::string_view yourTurn {"Your turn..."};
static constexpr std::string_view rematchPrompt {"Want to play again?"};
};
struct controlPrompts {
static constexpr std::string_view hit {"1. [H]it"};
static constexpr std::string_view stand {"2. [S]tand"};
static constexpr std::string_view yes {"1. [Y]es"};
static constexpr std::string_view no {"2. [N]o"};
};
std::string displayScore(const std::vector<int>& hand, bool hidden);
}
#define BOARD_WIDTH 48
#define BOARD_HEIGHT 32
int drawCard();
int calculateScore(const std::vector<int>& hand);
#endif