author | unc0rr |
Tue, 04 Dec 2012 22:31:22 +0400 | |
branch | flibqtfrontend |
changeset 8210 | ad178654142a |
parent 8092 | 08960209db8c |
permissions | -rw-r--r-- |
164 | 1 |
/* |
1066 | 2 |
* Hedgewars, a free turn based strategy game |
164 | 3 |
* Copyright (c) 2006 Igor Ulyanov <iulyanov@gmail.com> |
6952 | 4 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
164 | 5 |
* |
184 | 6 |
* This program is free software; you can redistribute it and/or modify |
7 |
* it under the terms of the GNU General Public License as published by |
|
8 |
* the Free Software Foundation; version 2 of the License |
|
164 | 9 |
* |
184 | 10 |
* This program is distributed in the hope that it will be useful, |
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
164 | 14 |
* |
184 | 15 |
* You should have received a copy of the GNU General Public License |
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
164 | 18 |
*/ |
19 |
||
20 |
#ifndef _HWMAP_INCLUDED |
|
21 |
#define _HWMAP_INCLUDED |
|
22 |
||
23 |
#include <QByteArray> |
|
24 |
#include <QString> |
|
25 |
#include <QImage> |
|
8092 | 26 |
#include <QTimer> |
164 | 27 |
|
177 | 28 |
#include "tcpBase.h" |
8092 | 29 |
#include "frontlib.h" |
3133 | 30 |
|
177 | 31 |
class HWMap : public TCPBase |
164 | 32 |
{ |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
33 |
Q_OBJECT |
2377 | 34 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
35 |
public: |
8070
66bc20d089fc
Okay, remove previous request only if it has same parent
unc0rr
parents:
8069
diff
changeset
|
36 |
HWMap(QObject *parent = 0); |
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
37 |
virtual ~HWMap(); |
8092 | 38 |
void getImage(const QString & seed, int templateFilter, int mapgen, int maze_size, const QByteArray & drawMapData); |
8069
bb7671829935
- Only allow one engine instance running at the moment
unc0rr
parents:
6952
diff
changeset
|
39 |
bool couldBeRemoved(); |
164 | 40 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
41 |
protected: |
8092 | 42 |
QStringList getArguments(); |
43 |
void onEngineStart(); |
|
177 | 44 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
45 |
signals: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
46 |
void ImageReceived(const QImage newImage); |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
47 |
void HHLimitReceived(int hhLimit); |
164 | 48 |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
49 |
private: |
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
50 |
QString m_seed; |
164 | 51 |
|
8092 | 52 |
flib_mapconn * m_conn; |
53 |
flib_map * m_map; |
|
54 |
||
55 |
static void onSuccess(void *context, const uint8_t *bitmap, int numHedgehogs); |
|
56 |
static void onFailure(void *context, const char *errormessage); |
|
6616
f77bb02b669f
astyle -C -S -L -N --style=allman --recursive "QTfrontend/*.cpp" "QTfrontend/*.h"
nemo
parents:
6060
diff
changeset
|
57 |
private slots: |
164 | 58 |
}; |
59 |
||
60 |
#endif // _HWMAP_INCLUDED |