author | kergoth <kergoth> | 2002-06-07 18:53:14 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-06-07 18:53:14 (UTC) |
commit | 640d964cfdc7467f6cacb513087cd3acda2c04f0 (patch) (unidiff) | |
tree | 9a784686c1795f8b1f81eb344598f3b549d43467 /noncore/games/wordgame/wordgame.h | |
parent | dfb9c76738bb68e235114c5ad43dbd26a59b98ab (diff) | |
download | opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.zip opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.gz opie-640d964cfdc7467f6cacb513087cd3acda2c04f0.tar.bz2 |
Backing out unintentional merge from TT branch.
Diffstat (limited to 'noncore/games/wordgame/wordgame.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/games/wordgame/wordgame.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/noncore/games/wordgame/wordgame.h b/noncore/games/wordgame/wordgame.h index 0ffa56a..f73c85a 100644 --- a/noncore/games/wordgame/wordgame.h +++ b/noncore/games/wordgame/wordgame.h | |||
@@ -139,24 +139,26 @@ public: | |||
139 | Tile tile(int i) const { return item[i]->tile(); } | 139 | Tile tile(int i) const { return item[i]->tile(); } |
140 | const Tile* tileRef(int i) const { return &item[i]->tile(); } | 140 | const Tile* tileRef(int i) const { return &item[i]->tile(); } |
141 | void remove(int i); | 141 | void remove(int i); |
142 | void remove(Tile); | 142 | void remove(Tile); |
143 | bool arrangeTiles(const Tile** s, int sn); | 143 | bool arrangeTiles(const Tile** s, int sn); |
144 | void setBlanks(const Tile*); | 144 | void setBlanks(const Tile*); |
145 | 145 | ||
146 | void setPlayerName(const QString& name) { nm = name; } | 146 | void setPlayerName(const QString& name) { nm = name; } |
147 | QString playerName() const { return nm; } | 147 | QString playerName() const { return nm; } |
148 | void setComputerization(int level) { cpu=level; } | 148 | void setComputerization(int level) { cpu=level; } |
149 | bool computerized() const { return cpu>0; } | 149 | bool computerized() const { return cpu>0; } |
150 | 150 | ||
151 | QSize sizeHint() const; | ||
152 | |||
151 | protected: | 153 | protected: |
152 | void resizeEvent(QResizeEvent*e); | 154 | void resizeEvent(QResizeEvent*e); |
153 | void contentsMousePressEvent(QMouseEvent*); | 155 | void contentsMousePressEvent(QMouseEvent*); |
154 | void contentsMouseMoveEvent(QMouseEvent*); | 156 | void contentsMouseMoveEvent(QMouseEvent*); |
155 | void contentsMouseReleaseEvent(QMouseEvent*); | 157 | void contentsMouseReleaseEvent(QMouseEvent*); |
156 | 158 | ||
157 | private: | 159 | private: |
158 | void clear(); | 160 | void clear(); |
159 | void layoutTiles(); | 161 | void layoutTiles(); |
160 | int n; | 162 | int n; |
161 | QArray<TileItem*> item; | 163 | QArray<TileItem*> item; |
162 | int dragging_adj; | 164 | int dragging_adj; |
@@ -202,24 +204,26 @@ public: | |||
202 | void finalizeTurn(); | 204 | void finalizeTurn(); |
203 | void showTurn(); | 205 | void showTurn(); |
204 | void scoreTurn(const QPoint& at, int n, const QPoint& d); | 206 | void scoreTurn(const QPoint& at, int n, const QPoint& d); |
205 | bool checkTurn(); | 207 | bool checkTurn(); |
206 | int score(QPoint at, const Tile** tiles, int n, | 208 | int score(QPoint at, const Tile** tiles, int n, |
207 | const Tile* blankvalue, | 209 | const Tile* blankvalue, |
208 | const QPoint& d, bool ignoredict, QStringList* words) const; | 210 | const QPoint& d, bool ignoredict, QStringList* words) const; |
209 | int bonussedValue(const QPoint& at, int base, int& all_mult) const; | 211 | int bonussedValue(const QPoint& at, int base, int& all_mult) const; |
210 | bool isStart(const QPoint& at) const; | 212 | bool isStart(const QPoint& at) const; |
211 | 213 | ||
212 | int turnScore() const { return turn_score; } | 214 | int turnScore() const { return turn_score; } |
213 | 215 | ||
216 | QSize sizeHint() const; | ||
217 | |||
214 | signals: | 218 | signals: |
215 | void temporaryScore(int); | 219 | void temporaryScore(int); |
216 | 220 | ||
217 | protected: | 221 | protected: |
218 | void contentsMousePressEvent(QMouseEvent*); | 222 | void contentsMousePressEvent(QMouseEvent*); |
219 | void contentsMouseMoveEvent(QMouseEvent*); | 223 | void contentsMouseMoveEvent(QMouseEvent*); |
220 | void contentsMouseReleaseEvent(QMouseEvent*); | 224 | void contentsMouseReleaseEvent(QMouseEvent*); |
221 | 225 | ||
222 | private: | 226 | private: |
223 | int idx(const QPoint& p) const | 227 | int idx(const QPoint& p) const |
224 | { return p.x()+p.y()*canvas()->tilesHorizontally(); } | 228 | { return p.x()+p.y()*canvas()->tilesHorizontally(); } |
225 | TileItem*& item(const QPoint& p) const | 229 | TileItem*& item(const QPoint& p) const |
@@ -322,25 +326,25 @@ private: | |||
322 | bool mayEndGame(); | 326 | bool mayEndGame(); |
323 | void openGameSelector(const QStringList& initnames); | 327 | void openGameSelector(const QStringList& initnames); |
324 | bool loadRules(const QString& filename); | 328 | bool loadRules(const QString& filename); |
325 | void addPlayer(const QString& name); | 329 | void addPlayer(const QString& name); |
326 | void addPlayer(const QString& name, int cpu); | 330 | void addPlayer(const QString& name, int cpu); |
327 | void nextPlayer(); | 331 | void nextPlayer(); |
328 | bool refillRack(int i); | 332 | bool refillRack(int i); |
329 | void readyRack(int i); | 333 | void readyRack(int i); |
330 | Rack* rack(int i) const; | 334 | Rack* rack(int i) const; |
331 | 335 | ||
332 | QWidgetStack *racks; | 336 | QWidgetStack *racks; |
333 | QToolBar* toolbar; | 337 | QToolBar* toolbar; |
334 | QVBox *vbox; | 338 | QWidget *vbox; |
335 | Board *board; | 339 | Board *board; |
336 | Bag *bag; | 340 | Bag *bag; |
337 | ScoreInfo *scoreinfo; | 341 | ScoreInfo *scoreinfo; |
338 | QToolButton *done; | 342 | QToolButton *done; |
339 | QToolButton *reset; | 343 | QToolButton *reset; |
340 | QTimer* aiheart; | 344 | QTimer* aiheart; |
341 | ComputerPlayer *cpu; | 345 | ComputerPlayer *cpu; |
342 | int player; | 346 | int player; |
343 | int nplayers; | 347 | int nplayers; |
344 | QStringList namelist; | 348 | QStringList namelist; |
345 | bool gameover; | 349 | bool gameover; |
346 | QString rules; | 350 | QString rules; |