Diffstat (limited to 'noncore/games/kcheckers/kcheckers.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/kcheckers/kcheckers.h | 46 |
1 files changed, 37 insertions, 9 deletions
diff --git a/noncore/games/kcheckers/kcheckers.h b/noncore/games/kcheckers/kcheckers.h index e86524f..ccf5bae 100644 --- a/noncore/games/kcheckers/kcheckers.h +++ b/noncore/games/kcheckers/kcheckers.h | |||
@@ -3,95 +3,123 @@ | |||
3 | #define KCHECKERS_H | 3 | #define KCHECKERS_H |
4 | 4 | ||
5 | #include <qmainwindow.h> | 5 | #include <qmainwindow.h> |
6 | #include <qlabel.h> | 6 | #include <qlabel.h> |
7 | 7 | ||
8 | #include "field.h" | 8 | #include "field.h" |
9 | #include "checkers.h" | 9 | #include "checkers.h" |
10 | 10 | ||
11 | #define WOOD 1 | 11 | #define WOODEN 1 |
12 | #define MARBLE 2 | 12 | #define GREEN 2 |
13 | #define MARBLE 3 | ||
13 | 14 | ||
14 | #define ENGLISH 11 | 15 | #define ENGLISH 11 |
15 | #define RUSSIAN 12 | 16 | #define RUSSIAN 12 |
16 | 17 | ||
17 | #define BEGINNER 2 | 18 | #define BEGINNER 2 |
18 | #define NOVICE 4 | 19 | #define NOVICE 4 |
19 | #define AVERAGE 5 | 20 | #define AVERAGE 6 |
20 | #define GOOD 6 | 21 | #define GOOD 7 |
21 | #define EXPERT 7 | 22 | #define EXPERT 8 |
22 | #define MASTER 8 | 23 | #define MASTER 9 |
24 | |||
25 | class QToolButton; | ||
23 | 26 | ||
24 | 27 | ||
25 | class KCheckers:public QMainWindow | 28 | class KCheckers:public QMainWindow |
26 | { | 29 | { |
27 | Q_OBJECT | 30 | Q_OBJECT |
28 | public: | 31 | public: |
29 | KCheckers(); | 32 | KCheckers(); |
30 | 33 | ||
34 | protected: | ||
35 | void closeEvent(QCloseEvent*); | ||
36 | |||
31 | private slots: | 37 | private slots: |
38 | |||
39 | void help(); | ||
32 | void about(); | 40 | void about(); |
33 | void aboutQt(); | 41 | void aboutQt(); |
34 | void newGame(); | 42 | void newGame(); |
35 | void click(int); // Processes the mouse clics on fields | 43 | void undoMove(); |
44 | void click(int); | ||
45 | void showNumeration(); | ||
36 | 46 | ||
37 | void setSkillBeginner() {setSkill(BEGINNER);}; | 47 | void setSkillBeginner() {setSkill(BEGINNER);}; |
38 | void setSkillNovice() {setSkill(NOVICE);}; | 48 | void setSkillNovice() {setSkill(NOVICE);}; |
39 | void setSkillAverage() {setSkill(AVERAGE);}; | 49 | void setSkillAverage() {setSkill(AVERAGE);}; |
40 | void setSkillGood() {setSkill(GOOD);}; | 50 | void setSkillGood() {setSkill(GOOD);}; |
41 | void setSkillExpert() {setSkill(EXPERT);}; | 51 | void setSkillExpert() {setSkill(EXPERT);}; |
42 | void setSkillMaster() {setSkill(MASTER);}; | 52 | void setSkillMaster() {setSkill(MASTER);}; |
43 | 53 | ||
44 | void setPatternWood() {setPattern(WOOD);}; | 54 | void setPatternWooden() {setPattern(WOODEN);}; |
55 | void setPatternGreen() {setPattern(GREEN);}; | ||
45 | void setPatternMarble() {setPattern(MARBLE);}; | 56 | void setPatternMarble() {setPattern(MARBLE);}; |
46 | 57 | ||
47 | void setRulesEnglish() {setRules(ENGLISH);}; | 58 | void setRulesEnglish() {setRules(ENGLISH);}; |
48 | void setRulesRussian() {setRules(RUSSIAN);}; | 59 | void setRulesRussian() {setRules(RUSSIAN);}; |
49 | 60 | ||
50 | private: | 61 | private: |
62 | |||
51 | void compGo(); | 63 | void compGo(); |
52 | bool userGo(int); | 64 | bool userGo(int); |
53 | 65 | ||
54 | void drawBoard(); | 66 | void drawBoard(int); |
67 | void drawNumeration(); | ||
55 | void colorChange(); | 68 | void colorChange(); |
69 | void unselect(); | ||
70 | void readConfig(); | ||
56 | 71 | ||
57 | void setSkill(int); | 72 | void setSkill(int); |
58 | void setRules(int); | 73 | void setRules(int); |
59 | void setPattern(int); | 74 | void setPattern(int); |
60 | 75 | ||
61 | int from; // Selected by user | 76 | int from; // Selected by user |
62 | int skill; | 77 | int skill; |
63 | int rules; | 78 | int rules; |
64 | int pattern; | 79 | int pattern; |
80 | |||
81 | int numID; // Show Numeration | ||
82 | int undoID; // Undo Move | ||
83 | int undoBoard[32]; | ||
84 | |||
65 | bool gameOver; | 85 | bool gameOver; |
66 | bool selected; | 86 | bool selected; |
67 | bool userFirst; | 87 | bool userFirst; |
68 | 88 | ||
69 | Field* field[64]; // Fields of board | 89 | Field* field[64]; // Fields of board |
70 | 90 | ||
71 | QImage* imagePat1; // Patterns | 91 | QImage* imagePat1; // Patterns |
72 | QImage* imagePat2; | 92 | QImage* imagePat2; |
73 | QImage* imageFrame; // Frame of selected field | 93 | QImage* imageFrame; // Frame of selected field |
74 | 94 | ||
75 | QImage* imageWood1; | 95 | QImage* imageWood1; |
76 | QImage* imageWood2; | 96 | QImage* imageWood2; |
77 | QImage* imageWood3; | 97 | QImage* imageWood3; |
98 | QImage* imageGreen1; | ||
99 | QImage* imageGreen2; | ||
100 | QImage* imageGreen3; | ||
78 | QImage* imageMarble1; | 101 | QImage* imageMarble1; |
79 | QImage* imageMarble2; | 102 | QImage* imageMarble2; |
80 | QImage* imageMarble3; | 103 | QImage* imageMarble3; |
81 | 104 | ||
82 | QImage* imageMan1; | 105 | QImage* imageMan1; |
83 | QImage* imageMan2; | 106 | QImage* imageMan2; |
84 | QImage* imageKing1; | 107 | QImage* imageKing1; |
85 | QImage* imageKing2; | 108 | QImage* imageKing2; |
86 | 109 | ||
87 | Checkers* game; | 110 | Checkers* game; |
111 | QPopupMenu* gameMenu; | ||
88 | QPopupMenu* skillMenu; | 112 | QPopupMenu* skillMenu; |
89 | QPopupMenu* optionsMenu; | 113 | QPopupMenu* optionsMenu; |
114 | QToolButton* undoButton; | ||
90 | QLabel* statusLabel; | 115 | QLabel* statusLabel; |
91 | 116 | ||
117 | static QString enNumeration; | ||
118 | static QString ruNumeration; | ||
119 | |||
92 | static const int t[32]; // Translate table | 120 | static const int t[32]; // Translate table |
93 | 121 | ||
94 | }; | 122 | }; |
95 | 123 | ||
96 | #endif | 124 | #endif |
97 | 125 | ||