~aminesay/ktoe/Kmelo

« back to all changes in this revision

Viewing changes to src/gameBorad.h

  • Committer: safe
  • Date: 2008-06-17 14:19:47 UTC
  • Revision ID: safe@vaio-20080617141947-3xgqflzal3em62ah
0.5.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 * %An array containing pointer to MyButton widgets.
28
28
 *@ see MyButton
29
29
 */
30
 
typedef QPtrVector<MyButton>        wordButtons;
 
30
typedef QPtrVector <MyButton>        wordButtons;
 
31
//typedef QPtrVector <MyButton><MyButton>      wordButtons2d;
31
32
 
32
33
/**
33
34
 * 
106
107
                 *board.\n If we fail for a given number of tries to find a word we fall back using fuzzy word.\n
107
108
                 *\note optimize doesn't check if the word has been already used, this is done by fillGrid(). That's why we need to save the position we reached last time we called optimize.
108
109
                 * @param var The position we stopped at last time we called optimize.
109
 
                 * @return Word that can fit in the board.
 
110
                 * @return Word that can fit in the board. \bug optimize must be optimized  :) there are still duplicates !!
110
111
                 */
111
112
                QString optimize(unsigned int var);             
112
113
                        
131
132
                ///Remainig space in a coulumn/line. If the remaing space is less than \ref wordLenght then we put some fuzzy word.
132
133
                unsigned int remainingSpace;
133
134
 
134
 
                ///intermediate variable used by optimize().\bug get rid of stopedAt by replacing with a pointer.
 
135
                ///intermediate variable used by optimize(). StoppedAt is also used when colorizing it stores the position of the last colored button. \bug get rid of stopedAt by replacing with a pointer.
135
136
                unsigned int stopedAt;
136
137
                
137
138
                /// Word randomly gathered form the currently being used KVTML file.
179
180
                /// Holds the position of the button lastly clicked.
180
181
                int     lastClicked;
181
182
 
 
183
                /// Holds the number of the fuzzy lettre placment
 
184
                int fuzzyLettres;
 
185
 
 
186
 
182
187
                /** @short Holds the position of the button firstly clicked.
183
188
                *
184
189
                * When clicking a second time we save lastClicked's value in firstClicked and update lastClicked one.\n The letters between lastClicked and firstClicked represent the current word chosen by the player.
217
222
                 */
218
223
                void    check();
219
224
 
 
225
 
 
226
 
 
227
 
 
228
void    startBoard();
 
229
 
 
230
bool putWord( int sens1, int sens2, int deb1, int deb2);
 
231
 
 
232
 
 
233
 
 
234
 
 
235
 
 
236
 
 
237
 
220
238
                /**
221
239
                 *@short Performs the appropriate actions when a word is selected by the player.
222
240
                 
259
277
                 */
260
278
                void cleanSelection(unsigned int from,unsigned int to);         
261
279
 
 
280
 
 
281
 
 
282
 
 
283
 
 
284
void makeSelection(unsigned int from,unsigned int to);          
 
285
 
262
286
                /** @short Reset game preparing for a new one. 
263
287
                *
264
288
                 * When starting a new game \ref state , \ref wordsNbr , \ref wordsFound , \ref mistakes ,... have to be set back to their default values.