-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboard.h
More file actions
63 lines (45 loc) · 1.2 KB
/
Copy pathboard.h
File metadata and controls
63 lines (45 loc) · 1.2 KB
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
60
61
62
63
#ifndef BOARD_H
#define BOARD_H
#include "myMap.h"
#include "bomb.h"
#include <QFrame>
#include <QPointer>
#include <queue>
class board:public QFrame
{
Q_OBJECT
public:
board(QWidget* parent=0);
bool tryMoveUp(player&);
bool tryMoveDown(player&);
bool tryMoveLeft(player&);
bool tryMoveRight(player&);
void trySetBomb(player&);
void setBomb(player&);
void countMapForDraw();
substance mapForDraw[10][10];
void keyPressEvent(QKeyEvent* event) Q_DECL_OVERRIDE;
private:
myMap m;
QSize sizeHint() const override;
QSize minimumSizeHint() const override;
QBasicTimer timer;
int cnt;
bool trySimpleMove(int x1,int y1,int x2,int y2);
bool tryPush(int x1,int y1,int x2,int y2);
bool tryInToHide(int x1,int y1,int x2,int y2);
bool tryMove(int x1,int y1,int x2,int y2);
void setFlame(const bomb&,direction);
bool inMap(int x,int y);
void initPlayer1();
void initPlayer2();
void trapPlayer(player&);
void tryTrapPlayer(int,int);
private slots:
void exploded(const bomb&);
protected:
void paintEvent(QPaintEvent*) override;
void timerEvent(QTimerEvent*) override;
player p1,p2;
};
#endif // BORAD_H