153 |
Tile t; |
Tile t; |
154 |
int row, col; |
int row, col; |
155 |
|
|
156 |
row = iRound.getRow(); |
row = iRound.getCoord().getRow(); |
157 |
col = iRound.getCol(); |
col = iRound.getCoord().getCol(); |
158 |
if (iRound.getDir() == Coord::HORIZONTAL) |
if (iRound.getCoord().getDir() == Coord::HORIZONTAL) |
159 |
{ |
{ |
160 |
for (int i = 0; i < iRound.getWordLen(); i++) |
for (int i = 0; i < iRound.getWordLen(); i++) |
161 |
{ |
{ |
194 |
{ |
{ |
195 |
int row, col; |
int row, col; |
196 |
|
|
197 |
row = iRound.getRow(); |
row = iRound.getCoord().getRow(); |
198 |
col = iRound.getCol(); |
col = iRound.getCoord().getCol(); |
199 |
if (iRound.getDir() == Coord::HORIZONTAL) |
if (iRound.getCoord().getDir() == Coord::HORIZONTAL) |
200 |
{ |
{ |
201 |
for (int i = 0; i < iRound.getWordLen(); i++) |
for (int i = 0; i < iRound.getWordLen(); i++) |
202 |
{ |
{ |
248 |
pts = 0; |
pts = 0; |
249 |
ptscross = 0; |
ptscross = 0; |
250 |
wordmul = 1; |
wordmul = 1; |
251 |
row = iRound.getRow(); |
row = iRound.getCoord().getRow(); |
252 |
col = iRound.getCol(); |
col = iRound.getCoord().getCol(); |
253 |
|
|
254 |
/* Is the word an extension of another word? */ |
/* Is the word an extension of another word? */ |
255 |
if (!iTilesMx[row][col - 1].isEmpty() || |
if (!iTilesMx[row][col - 1].isEmpty() || |
314 |
if (isolated && !firstturn) |
if (isolated && !firstturn) |
315 |
return 5; |
return 5; |
316 |
/* The first word must be horizontal */ |
/* The first word must be horizontal */ |
317 |
if (firstturn && iRound.getDir() == Coord::VERTICAL) |
if (firstturn && iRound.getCoord().getDir() == Coord::VERTICAL) |
318 |
return 6; |
return 6; |
319 |
/* The first word must cover the H8 square */ |
/* The first word must cover the H8 square */ |
320 |
if (firstturn |
if (firstturn |
334 |
|
|
335 |
int Board::checkRound(Round &iRound, bool firstturn) |
int Board::checkRound(Round &iRound, bool firstturn) |
336 |
{ |
{ |
337 |
if (iRound.getDir() == Coord::HORIZONTAL) |
if (iRound.getCoord().getDir() == Coord::HORIZONTAL) |
338 |
|
{ |
339 |
return checkRoundAux(m_tilesRow, m_crossRow, |
return checkRoundAux(m_tilesRow, m_crossRow, |
340 |
m_pointRow, m_jokerRow, |
m_pointRow, m_jokerRow, |
341 |
iRound, firstturn); |
iRound, firstturn); |
342 |
|
} |
343 |
else |
else |
344 |
{ |
{ |
|
int res, tmp; |
|
|
|
|
345 |
// XXX: ugly! |
// XXX: ugly! |
346 |
/* Exchange the coordinates temporarily */ |
// Exchange the coordinates temporarily |
347 |
tmp = iRound.getRow(); |
iRound.accessCoord().swap(); |
348 |
iRound.setRow(iRound.getCol()); |
|
349 |
iRound.setCol(tmp); |
int res = checkRoundAux(m_tilesCol, m_crossCol, |
350 |
|
m_pointCol, m_jokerCol, |
351 |
res = checkRoundAux(m_tilesCol, m_crossCol, |
iRound, firstturn); |
352 |
m_pointCol, m_jokerCol, |
|
353 |
iRound, firstturn); |
// Restore the coordinates |
354 |
|
iRound.accessCoord().swap(); |
|
/* Restore the coordinates */ |
|
|
tmp = iRound.getRow(); |
|
|
iRound.setRow(iRound.getCol()); |
|
|
iRound.setCol(tmp); |
|
355 |
|
|
356 |
return res; |
return res; |
357 |
} |
} |
363 |
Tile t; |
Tile t; |
364 |
int row, col; |
int row, col; |
365 |
|
|
366 |
row = iRound.getRow(); |
row = iRound.getCoord().getRow(); |
367 |
col = iRound.getCol(); |
col = iRound.getCoord().getCol(); |
368 |
if (iRound.getDir() == Coord::HORIZONTAL) |
if (iRound.getCoord().getDir() == Coord::HORIZONTAL) |
369 |
{ |
{ |
370 |
for (int i = 0; i < iRound.getWordLen(); i++) |
for (int i = 0; i < iRound.getWordLen(); i++) |
371 |
{ |
{ |