164
|
1 |
/*
|
1066
|
2 |
* Hedgewars, a free turn based strategy game
|
164
|
3 |
* Copyright (c) 2006 Igor Ulyanov <iulyanov@gmail.com>
|
|
4 |
*
|
184
|
5 |
* This program is free software; you can redistribute it and/or modify
|
|
6 |
* it under the terms of the GNU General Public License as published by
|
|
7 |
* the Free Software Foundation; version 2 of the License
|
164
|
8 |
*
|
184
|
9 |
* This program is distributed in the hope that it will be useful,
|
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
* GNU General Public License for more details.
|
164
|
13 |
*
|
184
|
14 |
* You should have received a copy of the GNU General Public License
|
|
15 |
* along with this program; if not, write to the Free Software
|
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
164
|
17 |
*/
|
|
18 |
|
|
19 |
#ifndef _HWMAP_INCLUDED
|
|
20 |
#define _HWMAP_INCLUDED
|
|
21 |
|
|
22 |
#include <QByteArray>
|
|
23 |
#include <QString>
|
|
24 |
#include <QImage>
|
|
25 |
|
177
|
26 |
#include "tcpBase.h"
|
164
|
27 |
|
3133
|
28 |
enum MapGenerator
|
|
29 |
{
|
|
30 |
MAPGEN_REGULAR,
|
|
31 |
MAPGEN_MAZE,
|
4487
|
32 |
MAPGEN_DRAWN,
|
4419
|
33 |
MAPGEN_LAST
|
3133
|
34 |
};
|
|
35 |
|
177
|
36 |
class HWMap : public TCPBase
|
164
|
37 |
{
|
|
38 |
Q_OBJECT
|
2377
|
39 |
|
164
|
40 |
public:
|
|
41 |
HWMap();
|
168
|
42 |
virtual ~HWMap();
|
4534
|
43 |
void getImage(const QString & seed, int templateFilter, MapGenerator mapgen, int maze_size, const QByteArray & drawMapData);
|
164
|
44 |
|
177
|
45 |
protected:
|
|
46 |
virtual QStringList setArguments();
|
|
47 |
virtual void onClientDisconnect();
|
|
48 |
virtual void SendToClientFirst();
|
|
49 |
|
164
|
50 |
signals:
|
|
51 |
void ImageReceived(const QImage newImage);
|
1790
|
52 |
void HHLimitReceived(int hhLimit);
|
164
|
53 |
|
|
54 |
private:
|
4534
|
55 |
QString m_seed;
|
1797
|
56 |
int templateFilter;
|
3133
|
57 |
MapGenerator m_mapgen;
|
|
58 |
int m_maze_size;
|
4489
|
59 |
QByteArray m_drawMapData;
|
164
|
60 |
|
|
61 |
private slots:
|
|
62 |
};
|
|
63 |
|
|
64 |
#endif // _HWMAP_INCLUDED
|