-
Notifications
You must be signed in to change notification settings - Fork 0
/
tetrisnetwork.h
86 lines (77 loc) · 1.9 KB
/
tetrisnetwork.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
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef TETRISTNETWORK_H
#define TETRISNETWORK_H
#include<QtGui>
#include<stdlib.h>
#include<string>
#include<iostream>
#include<sys/time.h>
#include<QtNetwork>
#include<QTcpServer>
using namespace std;
class TetrisNetwork : public QDialog {
Q_OBJECT
public:
TetrisNetwork();
virtual ~TetrisNetwork();
signals:
void netConnected(QString command);
void serverLeft1();
void serverRight1();
void serverFall1();
void serverRotate1();
void serverWin1();
void serverLose1();
void serverGameover1();
void serverAttack1(string line);
void serverPiece1(string piece);
void serverLeft2();
void serverRight2();
void serverFall2();
void serverRotate2();
void serverWin2();
void serverLose2();
void serverGameover2();
void serverAttack2(string line);
void serverPiece2(string piece);
void netGameMode(QString mode);
private:
void commandEmitter();
void createModeGroupBox();
void createServerGroupBox();
void createAnswerGroupBox();
bool isConnected;
bool humanMode;
bool computerMode;
bool qualifierMode;
QLineEdit * serverName;
QLineEdit * portNumber;
QTcpSocket * socket;
QPushButton * closeButton;
QGroupBox *serverGroupBox;
QGroupBox *answerGroupBox;
QGroupBox *modeGroupBox;
QTextEdit * tetrisAnswer;
QString srvMsg;
QLabel * serverLabel;
QLabel * portLabel;
QPushButton * connectButton;
QPushButton * readyButton;
QPushButton * hvsnButton;
QPushButton * cvsnButton;
QPushButton * qualifierButton;
private slots:
void connectionClosed();
void reportConnected();
void reportHostFound();
void closeSocket();
void command(QString order);
void getMessage();
void connectServer();
void sendStart();
void startItUp();
void sendGame1();
void sendGame2();
void sendGame3();
void disableButtons();
};
#endif