Diffstat (limited to 'noncore/games/zlines/field.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/zlines/field.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/noncore/games/zlines/field.h b/noncore/games/zlines/field.h new file mode 100644 index 0000000..b6cf845 --- a/dev/null +++ b/noncore/games/zlines/field.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /*************************************************************************** | ||
2 | field.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 __FIELD_H | ||
20 | #define __FIELD_H | ||
21 | |||
22 | #include <qobject.h> | ||
23 | #include <qwidget.h> | ||
24 | #include "cell.h" | ||
25 | |||
26 | // size of game field | ||
27 | #define NUMCELLSW 11 | ||
28 | #define NUMCELLSH 11 | ||
29 | |||
30 | class Field: public QWidget | ||
31 | { | ||
32 | Q_OBJECT | ||
33 | public: | ||
34 | void clearField(); | ||
35 | |||
36 | protected: | ||
37 | Field(QWidget* parent, const char* name); | ||
38 | ~Field(); | ||
39 | |||
40 | void putBall(int x, int y, int color); | ||
41 | void putBallRun(int x, int y, int color); | ||
42 | void removeBall(int x, int y ); | ||
43 | int getBall(int x, int y); | ||
44 | int getAnim(int x, int y); | ||
45 | void setAnim(int x, int y, int anim ); | ||
46 | void clearAnim(); | ||
47 | int deleteAnimatedBalls(); | ||
48 | void moveBall(int xa, int ya, int xb, int yb); | ||
49 | |||
50 | bool checkBounds( int x, int y ); | ||
51 | // virtual int erase5Balls(){ return 0;} | ||
52 | int freeSpace(); | ||
53 | void saveUndo(); | ||
54 | void restoreUndo(); | ||
55 | |||
56 | private: | ||
57 | Cell field[NUMCELLSH][NUMCELLSW]; | ||
58 | Cell field_undo[NUMCELLSH][NUMCELLSW]; | ||
59 | // void search5Balls(); | ||
60 | |||
61 | }; | ||
62 | |||
63 | #endif | ||