-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp2tparser.h
48 lines (39 loc) · 954 Bytes
/
p2tparser.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
#ifndef P2TPARSER_H
#define P2TPARSER_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QLibrary>
#include <QCoreApplication>
#define NORTH 0x01
#define EAST 0x02
#define SOUTH 0x04
#define WEST 0x08
#define ROBOT 0x10
#define ROBOT_WHITE 0
#define ROBOT_RED 1
#define ROBOT_GREEN 2
#define ROBOT_BLUE 3
typedef struct {
uint grid[256];
uint moves[256];
uint robots[4];
uint token;
uint last;
} Game;
typedef uint (*SearchFunction)(Game*, uchar*, void*);
class P2tParser : public QObject
{
Q_OBJECT
QNetworkAccessManager *m_pNetworkAccessManager;
SearchFunction search;
uint solveGame(Game *srcGame, uint robot);
bool m_spoil, m_spoilMore;
public:
explicit P2tParser(bool spoil, bool spoilMore, QString date, QObject *parent = 0);
signals:
private slots:
void parseResponse(QNetworkReply *httpReply);
};
#endif // P2TPARSER_H