-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.h
120 lines (70 loc) · 2.39 KB
/
game.h
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//
// Created by iDarkDuck on 2018-10-19.
//
#ifndef CPP_PROJECT_MEMORY_GAME_GAME_H
#define CPP_PROJECT_MEMORY_GAME_GAME_H
#include <map>
#include <stdexcept>
#include "board.h"
#include "player.h"
#include "card.h"
#include "rewarddeck.h"
inline const extern vector<Side> sides = {Side::Top, Side::Bottom, Side::Left, Side::Right};
class Game {
public:
Game(int &, int &);
int getRound() const;
void addPlayer(const Player &);
Player &getPlayer(Side);
const Card *getPreviousCard() const;
const Card *getCurrentCard() const;
void setCurrentCard(const Card *);
Card *getCard(const Letter &, const Number &);
void setCard(const Letter &, const Number &, Card *);
friend ostream &operator<<(ostream &, const Game &);
void nextRound();
private:
int mode{0};
int nRound{0};
Side currentSide;
vector<Player> players;
Board board;
vector<vector<const Card *>> cards;
vector<const Reward *> rewardDeck;
map<string, Card *> cardMap;
bool ready = false;
string walrusBlockValue;
int &sideCounter;
void setSide(Side);
void setMode();
void createPlayers(int &);
bool containsPlayer(const Player &);
void makeCardDeck();
void makeRewardDeck();
void setAllPlayersActive();
void temporaryRevealThreeCards();
void getValidInput(Letter *letter, Number *number, const FaceAnimal &);
int toEnum(const char &);
void awardActivePlayers();
void printLeastToMostRubiesAndWinner() const;
void expertModePrint() const;
bool twoCardsSelected() const;
void clearSelectedCards();
void reset();
char LetterToChar(const Letter &);
string convertToString(const Letter &, const Number &);
bool isValidCard(const Letter &letter, const Number &number);
Card *getExpertCard(Letter &, Number &, const FaceAnimal &);
Card *getExpertCard(const Letter &, const Number &);
void setExpertCurrentCard(const Card *);
void getExpertRulesInput();
void expertRules(Card *, Letter &, Number &, int &);
void expertOctopus(Card *, Letter &, Number &);
void expertPenguin(int &);
void expertWalrus();
void expertCrab(Card *, Letter &, Number &, int &);
void expertTurtle();
void swapCards(const Letter &, const Number &, const Letter &, const Number &);
map<string, Card *> &getCardMap();
};
#endif //CPP_PROJECT_MEMORY_GAME_GAME_H