-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameView.h
66 lines (54 loc) · 1.63 KB
/
GameView.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
#ifndef MVC_VIEW_H
#define MVC_VIEW_H
#include <gtkmm.h>
#include "observer.h"
#include "DeckGUI.h"
#include "CardButton.h"
#include "TableCard.h"
#include <vector>
#include "PlayerInfoView.h"
class GameViewController;
class Game;
class Player;
// class declaration for the main GameView
class GameView : public Gtk::Window, public Observer {
public:
GameView( GameViewController*, Game* ); // constructor
virtual ~GameView(); // destructor
virtual void update(); // Observer Pattern: concrete update() method
private:
// Observer Pattern: to access Model accessors
Game *model_;
// Strategy Pattern member (plus signal handlers)
GameViewController *controller_;
DeckGUI deck;
// Member widgets:
Gtk::HBox menu;
Gtk::Frame menuFrame;
Gtk::Frame cardsPlayedFrame;
Gtk::Frame handFrame;
Gtk::VBox playing_space;
Gtk::HBox players_controls;
Gtk::HButtonBox player_hand;
Gtk::HBox hpanels; // Main window divided into two horizontal panels
Gtk::VBox vpanels; // Vertical boxes for stacking buttons vertically
Gtk::Button start_button;
Gtk::Button end_button;
Gtk::Entry seed;
Gtk::Image card;
// Boxes for each suit on the table
Gtk::HBox spades;
Gtk::HBox hearts;
Gtk::HBox clubs;
Gtk::HBox diamonds;
// vector of player info frames for each player
vector <PlayerInfoView*> playerInfoFrames;
// Signal handlers:
void startButtonClicked();
void endButtonClicked();
void cardClicked(int i);
void seedEntryChanged();
vector<CardButton*> cards_; // vector for the cards to show in player's hand
std::map<Suit, vector<TableCard*> > cardsPlayed_; // map of all of the cards played in the game
};
#endif