author | waspe <waspe> | 2003-05-16 16:34:55 (UTC) |
---|---|---|
committer | waspe <waspe> | 2003-05-16 16:34:55 (UTC) |
commit | 11b6ce5ac500dce757ccdd0a5f5b5ecd7fb866c8 (patch) (unidiff) | |
tree | 3013dbafcb4e1f919e104204d1288f0309da5641 /noncore/games/backgammon/backgammon.h | |
parent | 75f1e9815410e75a6f9ae76d8db716c0c315ea45 (diff) | |
download | opie-11b6ce5ac500dce757ccdd0a5f5b5ecd7fb866c8.zip opie-11b6ce5ac500dce757ccdd0a5f5b5ecd7fb866c8.tar.gz opie-11b6ce5ac500dce757ccdd0a5f5b5ecd7fb866c8.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'noncore/games/backgammon/backgammon.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/backgammon/backgammon.h | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/noncore/games/backgammon/backgammon.h b/noncore/games/backgammon/backgammon.h index 40dbaba..e3276f1 100644 --- a/noncore/games/backgammon/backgammon.h +++ b/noncore/games/backgammon/backgammon.h | |||
@@ -1,134 +1,120 @@ | |||
1 | #ifndef BACKGAMMON_H | 1 | #ifndef BACKGAMMON_H |
2 | #define BACKGAMMON_H | 2 | #define BACKGAMMON_H |
3 | 3 | ||
4 | #include "backgammonview.h" | ||
4 | #include "canvasimageitem.h" | 5 | #include "canvasimageitem.h" |
5 | #include "definition.h" | ||
6 | //#include "rulesdialog.h" | 6 | //#include "rulesdialog.h" |
7 | #include "moveengine.h" | 7 | #include "moveengine.h" |
8 | 8 | ||
9 | #include <qcanvas.h> | 9 | |
10 | #include <qlabel.h> | 10 | #include <qlabel.h> |
11 | #include <qlineedit.h> | 11 | #include <qmainwindow.h> |
12 | #include <qwidget.h> | 12 | //#include <qwidget.h> |
13 | 13 | ||
14 | 14 | ||
15 | class BackGammonView : public QCanvasView | ||
16 | { | ||
17 | Q_OBJECT | ||
18 | public: | ||
19 | BackGammonView(QCanvas* canvas,QWidget* parent); | ||
20 | ~BackGammonView(); | ||
21 | signals: | ||
22 | void mouse(int,int); | ||
23 | private: | ||
24 | void contentsMousePressEvent(QMouseEvent* e); | ||
25 | }; | ||
26 | 15 | ||
27 | class BackGammon : public QWidget | 16 | |
17 | class BackGammon : public QMainWindow | ||
28 | { | 18 | { |
29 | Q_OBJECT | 19 | Q_OBJECT |
30 | private: | 20 | private: |
31 | //GUI | 21 | //GUI |
32 | //is the style not qte ? | ||
33 | bool non_qte; | ||
34 | int offset; | ||
35 | //the "status" bar | 22 | //the "status" bar |
36 | QLineEdit* inputfield; | 23 | QLabel* message; |
37 | //the main drawing area | 24 | //the main drawing area |
38 | QCanvas* area; | 25 | QCanvas* area; |
39 | BackGammonView* boardview; | 26 | BackGammonView* boardview; |
40 | CanvasImageItem* board; | 27 | CanvasImageItem* board; |
41 | CanvasImageItem* table; | 28 | CanvasImageItem* table; |
42 | CanvasImageItem** p1; | 29 | CanvasImageItem** p1; |
43 | CanvasImageItem** p2; | 30 | CanvasImageItem** p2; |
44 | CanvasImageItem** p1_side; | 31 | CanvasImageItem** p1_side; |
45 | CanvasImageItem** p2_side; | 32 | CanvasImageItem** p2_side; |
46 | 33 | ||
47 | CanvasImageItem** diceA1; | 34 | CanvasImageItem** diceA1; |
48 | CanvasImageItem** diceA2; | 35 | CanvasImageItem** diceA2; |
49 | CanvasImageItem** diceB1; | 36 | CanvasImageItem** diceB1; |
50 | CanvasImageItem** diceB2; | 37 | CanvasImageItem** diceB2; |
51 | //CanvasImageItem** oddsDice; | 38 | //CanvasImageItem** oddsDice; |
52 | CanvasImageItem* nomove_marker; | 39 | CanvasImageItem* nomove_marker; |
53 | 40 | ||
54 | QCanvasRectangle* marker_current; | 41 | QCanvasRectangle* marker_current; |
55 | QCanvasRectangle* marker_next[4]; | 42 | QCanvasRectangle* marker_next[4]; |
56 | QLabel* message; | 43 | |
57 | //ENGINE | 44 | //ENGINE |
58 | MoveEngine* move; | 45 | MoveEngine* move; |
59 | //the dice values | 46 | //the dice values |
60 | int diceA1_value; | 47 | int diceA1_value; |
61 | int diceA2_value; | 48 | int diceA2_value; |
62 | int diceA3_value; | 49 | int diceA3_value; |
63 | int diceA4_value; | 50 | int diceA4_value; |
64 | int diceB1_value; | 51 | int diceB1_value; |
65 | int diceB2_value; | 52 | int diceB2_value; |
66 | int diceB3_value; | 53 | int diceB3_value; |
67 | int diceB4_value; | 54 | int diceB4_value; |
68 | 55 | ||
69 | int player; | 56 | int player; |
70 | bool dice1_played; | 57 | bool dice1_played; |
71 | bool dice2_played; | 58 | bool dice2_played; |
72 | bool dice3_played; | 59 | bool dice3_played; |
73 | bool dice4_played; | 60 | bool dice4_played; |
74 | bool dice_rolled; | 61 | bool dice_rolled; |
75 | //computer opponent | 62 | //computer opponent |
76 | bool player1_auto; | 63 | bool player1_auto; |
77 | bool player2_auto; | 64 | bool player2_auto; |
78 | 65 | ||
79 | //the images; | 66 | //the images; |
80 | QString theme_name; | 67 | QString theme_name; |
81 | QString board_name; | 68 | QString board_name; |
82 | QString piecesA_name; | 69 | QString piecesA_name; |
83 | QString piecesB_name; | 70 | QString piecesB_name; |
84 | QString diceA_name; | 71 | QString diceA_name; |
85 | QString diceB_name; | 72 | QString diceB_name; |
86 | QString odds_name; | 73 | QString odds_name; |
87 | QString table_name; | 74 | QString table_name; |
88 | 75 | ||
89 | //save game | 76 | //save game |
90 | QString game_name; | 77 | QString game_name; |
91 | 78 | ||
92 | //the rules | 79 | //the rules |
93 | Rules rules; | 80 | Rules rules; |
94 | 81 | ||
95 | //display settings | 82 | //display settings |
96 | Display display; | 83 | Display display; |
97 | //is the game finished ? | 84 | //is the game finished ? |
98 | bool gameFinished; | 85 | bool gameFinished; |
99 | 86 | ||
100 | public: | 87 | public: |
101 | BackGammon( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 88 | BackGammon( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
102 | ~BackGammon(); | 89 | ~BackGammon(); |
103 | private slots: | 90 | private slots: |
104 | void newgame(); | 91 | void newgame(); |
105 | void playerselect(); | 92 | void playerselect(); |
106 | void loadgame(); | 93 | void loadgame(); |
107 | void savegame(); | 94 | void savegame(); |
108 | void deletegame(); | 95 | void deletegame(); |
109 | void newtheme(); | 96 | void newtheme(); |
110 | void loadtheme(); | 97 | void loadtheme(); |
111 | void savetheme(); | 98 | void savetheme(); |
112 | void themedefault(); | 99 | void themedefault(); |
113 | void deletetheme(); | 100 | void deletetheme(); |
114 | void modify_AI(); | 101 | void modify_AI(); |
115 | void setrules(); | 102 | void setrules(); |
116 | void displaySettings(); | ||
117 | void mouse(int x,int y); | 103 | void mouse(int x,int y); |
118 | void done_dice1(); | 104 | void done_dice1(); |
119 | void done_dice2(); | 105 | void done_dice2(); |
120 | void done_dice3(); | 106 | void done_dice3(); |
121 | void done_dice4(); | 107 | void done_dice4(); |
122 | void nomove(); | 108 | void nomove(); |
123 | void nomove2(); | 109 | void nomove2(); |
124 | void finished(int theplayer); | 110 | void finished(int theplayer); |
125 | void autoroll_dice1(); | 111 | void autoroll_dice1(); |
126 | void autoroll_dice2(); | 112 | void autoroll_dice2(); |
127 | private: | 113 | private: |
128 | void draw(); | 114 | void draw(); |
129 | void showdice(); | 115 | void showdice(); |
130 | void setplayer(); | 116 | void setplayer(); |
131 | void applytheme(); | 117 | void applytheme(); |
132 | }; | 118 | }; |
133 | 119 | ||
134 | #endif //BACKGAMMON_H | 120 | #endif //BACKGAMMON_H |