blob: 052d6e9d99103cdad594dfd9d3383e4f9de35ce5 (
plain)
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
|
#ifndef _MAP_WIDGET_H
#define _MAP_WIDGET_H
#include <qwidget.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qgridview.h>
#include <qtimer.h>
#include "gamecore.h"
#include "images.h"
class ConquestMap : public QGridView
{
Q_OBJECT
// Constructors
public:
ConquestMap( Map *newMap, QWidget *parent = 0 );
virtual ~ConquestMap();
// Interface
public:
void unselectPlanet();
protected:
virtual void contentsMousePressEvent( QMouseEvent *e );
virtual void contentsMouseMoveEvent( QMouseEvent *e );
virtual void paintCell( QPainter *p, int row, int col );
private slots:
void mapUpdate();
void squareBlink();
signals:
void planetSelected( Planet * );
void planetHighlighted( Planet * );
private:
const int SECTOR_HEIGHT;
const int SECTOR_WIDTH;
const int BOARD_HEIGHT;
const int BOARD_WIDTH;
void drawSector( QPainter *, Sector &, bool borderStrobe = true, bool highlight = false );
Map *map;
QColor gridColor;
QFont labelFont;
int hiLiteRow, hiLiteCol;
};
#endif
|