-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
56 lines (43 loc) · 1.01 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QDebug>
#include <QList>
#include <QStringList>
#include "game.h"
#include "title.h"
#include "usersettings.h"
#include "gamefactory.h"
namespace Ui {
class MainWindow;
}
class Game;
class Title;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void setUser(QString userName);
//user operations
UserSettings* user(){ return &m_user; }
QStringList getAllUserNames(){ return m_userNames; }
bool addUser(QString userName);
bool removeUser(QString userName);
public slots:
void startGame(int);
void stopGame();
private:
void removeWidget(QWidget* widget);
void initGame(int gameId);
void initTitle(bool isUserSelected = false);
void initUserNames();
GameFactory m_gameFactory;
Game* m_game;
Title* m_title;
UserSettings m_user;
Ui::MainWindow *ui;
QStringList m_userNames;
};
#endif // MAINWINDOW_H