-
Notifications
You must be signed in to change notification settings - Fork 26
/
rooms.h
executable file
·74 lines (72 loc) · 1.76 KB
/
rooms.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
#ifndef ROOMS_H
#define ROOMS_H
#include <QMainWindow>
#include <QToolButton>
#include <QDialog>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QMessageBox>
#include <QQueue>
#include "request.h"
#include "factory.h"
#include "chatroom.h"
class rooms: public QMainWindow
{
Q_OBJECT
public:
explicit rooms(QWidget *parent = 0);
QString playerName;
QString owner_;
ChatRoom* chatRoom;
QPushButton* startGameBtn;
void initialPlayerRequest();
void doOfflineRequest();
private:
void initialmainWidget();
void intialRoomPlayersWidget();
void initialRoomsListBtn();
void initialCreateroomDialog();
void showEvent(QShowEvent *);
void closeEvent(QCloseEvent*);
void flushRoomList();
void doEnterRoom();
void startRq();
void beReady();
private:
Factory* fac;
QTcpSocket* tcpSocket;
QLabel* playerLbl;
QToolButton* emptyBtn;
bool haveEmpty;
bool haveinitial;
bool newRoomCreated;
bool LeaveDone;
bool Ready;
int initialSize;
QToolButton* ownerTbt;
QToolButton* playerTbt;
QWidget* roomInfo;
QWidget* roomPlayers;
QWidget* roomsList;
QString roomName;
QTimer* flushRoomListTimer;
QToolButton **roomsListButtons;
QToolButton* newRoomBtn;
QQueue<std::pair<QString,QString>> roomsListQueue;
QVBoxLayout* ListLayout;
QLineEdit* nameEdit;
QDialog* CreateroomName;
private slots:
void slotConnected();
void dataReceived();
void CreateRoom();
void DeleteRoom();
void doCreateRoom();
void EnterRoom();
void LeaveRoom();
void returnRoomList();
void GameStart();
void CheckLeaveStatus();
};
#endif // ROOMS_H