-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
108 lines (90 loc) · 2.71 KB
/
mainwindow.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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QGraphicsScene>
#include <QGraphicsView>
#include "deck.h"
#include "cardimgfactory.h"
#include "gameresults.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
void HandleAITurn();
public slots:
void EmptyClickedSlot(Card*);
void RemedyClickedSlot(Card*);
void HazardClickedSlot(Card*);
void SafetyClickedSlot(Card*);
void DistanceClickedSlot(Card*);
void PlayAI();
void CloseApplication();
void PlayAgainSlot();
private slots:
void on_readyButton_clicked();
void on_drawButton_clicked();
void on_dist_button_1_clicked();
void on_dist_button_2_clicked();
void on_dist_button_3_clicked();
void on_dist_button_4_clicked();
void on_dist_button_5_clicked();
void on_safety_button_1_clicked();
void on_safety_button_2_clicked();
void on_safety_button_3_clicked();
void on_safety_button_4_clicked();
void on_safety_button_5_clicked();
private:
// Private Methods
void DisplayCurrentPlayer(Player*);
void InitializeCards();
void GameStartPopUps(QWidget *parent);
void SetLabels(QLabel* name, QPushButton* distance_button, QPushButton* safety_button, QLabel* dist_label, int index);
void SetHandLabel();
void HandCardClicked(Card*);
void BuildInitialGame();
void PlayActionCard(Card*, unsigned long);
bool PlayDistCard();
void PlaySafetyCard(SafetyCard*, bool);
void PlayLimitCard(Card* curr_limit, unsigned long index);
void ReplaceWithEmpty(Card*);
void ChangeHands();
void SwapForGo();
void CoupeFourre(Card* rem_card, SafetyCard* safety_card, unsigned long i);
bool FindMatch(safeties curr_safety, RemedyCard* action_card);
bool FindMatch(safeties curr_safety, HazardCard* action_card);
void ResetIndicators();
bool CheckForGameOver();
bool CheckForEmptyHand(Player* player);
void GameOver();
void AI(Player* player);
void InitializeGame();
void ResetAllPlayers();
//Private Data Members
Ui::MainWindow *ui;
QGraphicsScene* scene;
GameResults* results_window_;
Deck* deck_;
Card* card_backs[MAX_HAND_SIZE];
Card* curr_card_;
Card* prev_card_;
QRect curr_rect_;
QRect hand_rect_;
bool hide_;
bool card_clicked_;
bool coup_fourre_;
bool empty_deck_;
bool game_over_;
bool draw_;
QGraphicsDropShadowEffect* button_effect_;
QGraphicsDropShadowEffect* hide_effect_;
std::vector<Player*> players_;
std::vector<QString> names_;
int num_players_;
unsigned long curr_player_;
};
#endif // MAINWINDOW_H