-
Notifications
You must be signed in to change notification settings - Fork 4
/
Panel.h
54 lines (43 loc) · 966 Bytes
/
Panel.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
#ifndef PANEL_H
#define PANEL_H
#include <QWidget>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QStack>
#include "Controller.h"
#include "QiziWidget.h"
class Panel : public QWidget
{
Q_OBJECT
public:
explicit Panel(QWidget *parent = 0);
~Panel();
struct StepRecord
{
Step step;
QiziWidget* qiziWidget;
};
void create(QRect validRect, int row, int column);
void reset();
void start(Qizi qizi, bool firstDrop);
Qizi myQizi();
Qizi otherQizi();
void regret(Qizi qizi);
protected:
virtual void mousePressEvent(QMouseEvent* event);
virtual void paintEvent(QPaintEvent* event);
Pos pointToPos(const QPoint& pt);
QPoint posToPoint(const Pos& pos);
signals:
void dropMine(Step step);
void win(Qizi qizi);
public slots:
void dropQizi(Step step);
protected:
QRect m_validRect;
int m_row;
int m_column;
Controller* m_gameCtrl;
QStack<StepRecord> m_stepRecord;
};
#endif // PANEL_H