Diffstat (limited to 'noncore/games/zlines/linesboard.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/zlines/linesboard.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/noncore/games/zlines/linesboard.h b/noncore/games/zlines/linesboard.h new file mode 100644 index 0000000..97697cd --- a/dev/null +++ b/noncore/games/zlines/linesboard.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /*************************************************************************** | ||
2 | linesboard.h - description | ||
3 | ------------------- | ||
4 | begin : Fri May 19 2000 | ||
5 | copyright : (C) 2000 by Roman Merzlyakov | ||
6 | email : roman@sbrf.barrt.ru | ||
7 | copyright : (C) 2000 by Roman Razilov | ||
8 | email : Roman.Razilov@gmx.de | ||
9 | ***************************************************************************/ | ||
10 | |||
11 | /*************************************************************************** | ||
12 | * * | ||
13 | * This program is free software; you can redistribute it and/or modify * | ||
14 | * it under the terms of the GNU General Public License as published by * | ||
15 | * the Free Software Foundation; either version 2 of the License, or * | ||
16 | * (at your option) any later version. * | ||
17 | * * | ||
18 | ***************************************************************************/ | ||
19 | #ifndef __linesboard_h | ||
20 | #define __linesboard_h | ||
21 | |||
22 | #include <qwidget.h> | ||
23 | #include <qpixmap.h> | ||
24 | #include <qtimer.h> | ||
25 | |||
26 | #include "field.h" | ||
27 | //#include "shotcounter.h" | ||
28 | #include "ballpainter.h" | ||
29 | |||
30 | #ifdef Q_WS_QWS | ||
31 | #define debug (void) | ||
32 | #else | ||
33 | #define debug qDebug | ||
34 | #endif | ||
35 | #define fatal qFatal | ||
36 | #define warning qWarning | ||
37 | |||
38 | class LinesBoard : public Field | ||
39 | { | ||
40 | Q_OBJECT | ||
41 | public: | ||
42 | LinesBoard( BallPainter * abPainter, QWidget* parent=0, const char* name=0 ); | ||
43 | ~LinesBoard(); | ||
44 | |||
45 | int width(); | ||
46 | int height(); | ||
47 | int wHint(); | ||
48 | int hHint(); | ||
49 | // void doAfterBalls(); | ||
50 | void placeBalls(int nextBalls[BALLSDROP]); | ||
51 | void undo(); | ||
52 | |||
53 | signals: | ||
54 | void endTurn(); | ||
55 | void endGame(); | ||
56 | void eraseLine(int nb); | ||
57 | |||
58 | private: | ||
59 | int anim; | ||
60 | |||
61 | struct Waypoints { | ||
62 | int x,y; | ||
63 | } *way; | ||
64 | int nextBalls[BALLSDROP]; | ||
65 | |||
66 | int animmax; | ||
67 | |||
68 | //used for running and animation phase | ||
69 | int painting; | ||
70 | int animstep; | ||
71 | int animdelaycount; | ||
72 | int animdelaystart; | ||
73 | int direction; | ||
74 | |||
75 | |||
76 | int nextBallToPlace; | ||
77 | int jumpingCol; | ||
78 | int jumpingRow; | ||
79 | |||
80 | |||
81 | QTimer* timer; | ||
82 | // ShotCounter* shCounter; | ||
83 | BallPainter* bPainter; | ||
84 | |||
85 | void paintEvent( QPaintEvent* ); | ||
86 | void mousePressEvent( QMouseEvent* ); | ||
87 | |||
88 | void AnimStart(int panim); | ||
89 | void AnimNext(); | ||
90 | int AnimEnd(); | ||
91 | int getAnim(int x, int y ); // returns if the specifyed cell is animated.. | ||
92 | void AnimJump( int col, int row ); | ||
93 | |||
94 | int erase5Balls(); | ||
95 | bool existPath(int ax, int ay, int bx, int by); | ||
96 | void placeBall(); | ||
97 | |||
98 | protected slots: | ||
99 | void timerSlot(); | ||
100 | |||
101 | }; | ||
102 | |||
103 | #endif | ||