-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayFrame.h
63 lines (47 loc) · 1.79 KB
/
PlayFrame.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
#ifndef PLAY_FRAME
#define PLAY_FRAME
#include "Observer.h"
#include <gtkmm/box.h>
#include <gtkmm/image.h>
#include <gtkmm/label.h>
#include <gtkmm/button.h>
#include <gtkmm/dialog.h>
#include <gtkmm/stock.h>
#include <sigc++/connection.h>
#include <vector>
#include "DeckGUI.h"
#include "GameController.h"
// Frame which contains the cards and so on
class PlayFrame : public Observer {
public:
PlayFrame(GameController *, Game *); // constructor
virtual ~PlayFrame(); // destructor
void notify(); // used to notify of updates
protected:
void on_card_play(const Card &); // called with card which was played
private:
GameController *gc_; // controller - used to call when input on gui occurs such as card click
Game *g_; // facade
// GUI elements
Gtk::VBox playArea;
Gtk::Image* suitRows[SUIT_COUNT][RANK_COUNT]; // used to store all the images of cards on table
Gtk::Frame tableFrame; // frame for table
Gtk::VBox table;
std::vector<Gtk::HBox*> tableRows; // invidual rows on the table storing cards of different suit
Gtk::Button handButtons[RANK_COUNT]; // buttons which are basically the cards in the hand
sigc::connection handButtonConnections[RANK_COUNT]; // button listeners for the hand buttons
Gtk::Image* handImages[RANK_COUNT]; // used to store all images of cards on hand
Gtk::Frame handFrame; // frame to store hand
Gtk::HBox hand;
// dialog for invalid moves
Gtk::Label dialogLabel;
Gtk::Dialog invalidMoveDialog;
// dialog for round end
Gtk::Label endRoundLabel;
Gtk::Dialog endRoundDialog;
// dialog for winners
Gtk::Label winnersLabel;
Gtk::Dialog winnersDialog;
DeckGUI deckImages; // used to retrieve images of cards in deck
};
#endif