-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
74 lines (60 loc) · 1.55 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtGui/QMainWindow>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QGraphicsRectItem>
#include <QTimer>
#include <QTimeLine>
#include <QGraphicsItemAnimation>
#include <QPushButton>
#include <QTextEdit>
#include <QLineEdit>
#include <QListView>
#include <QListWidget>
#include <QFormLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QRadioButton>
#include <QKeyEvent>
#include <ostream>
#include <string>
#include <vector>
#include <fstream>
#include <QGraphicsSimpleTextItem>
#include "gamewindow.h"
#include "scoreentry.h"
using namespace std;
#define WINDOW_MAX_X 250
#define WINDOW_MAX_Y 350
/** This class is the main window in which all other elements of the program reside in.
*/
class GameWindow;
class MainWindow : public QWidget {
Q_OBJECT
public:
/** Default constructor which constructs the main window, which consists of a "gameView" followed by inputs and buttons to start the game.
*/
explicit MainWindow();
/** Destructor */
~MainWindow();
bool started;
GameWindow *gameView;
vector<ScoreEntry> ScoreList;
private:
QString name;
QGraphicsScene *scene;
QVBoxLayout *gameLayout;
QVBoxLayout *consoleLayout;
QLineEdit *playerName;
QRadioButton *normalMode;
QRadioButton *invincibleMode;
QListWidget *messageDisplay;
void keyPressEvent(QKeyEvent *e );
void keyReleaseEvent(QKeyEvent *e );
void loadScores();
public slots:
void startPauseGame();
void quitGame();
};
#endif // MAINWINDOW_H