-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrendercommunicator.h
58 lines (44 loc) · 1.12 KB
/
rendercommunicator.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
#ifndef RENDERCOMMUNICATOR_H
#define RENDERCOMMUNICATOR_H
#include <QObject>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QJsonDocument>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QUrl>
#include <QUrlQuery>
#include <QString>
class RenderCommunicator : public QObject
{
Q_OBJECT
public:
explicit RenderCommunicator(QObject *parent = 0);
void setP1(QString name);
void setP2(QString name);
void setP1Hand(int *hand);
void setP2Hand(int *hand);
void addCurrentMinion(QJsonObject m);
void addNewMinion(QJsonObject m);
void addBuilding(QJsonObject b);
void clear();
void sendMap(int time, int p1_mana, int p2_mana);
void sendEnd(int winner, int p1_destroy, int p2_destroy);
signals:
public slots:
private:
QString p1;
QString p2;
int p1_hand[4];
int p2_hand[4];
QJsonObject cmd;
QJsonArray current_minion;
QJsonArray new_minion;
QJsonArray buildings;
QNetworkAccessManager *renderServer;
QString hostAddress;
int port;
const QString minion_name[24];
};
#endif // RENDERCOMMUNICATOR_H