X-Git-Url: http://git.maemo.org/git/?p=impuzzle;a=blobdiff_plain;f=src%2Fgameview.cpp;h=2089637ecf365b7bcd8ab60ac0f49b61d13f0482;hp=2f70c51c8c8eaebfa276d559f41b1d07add06cfa;hb=fe6a84bdca195d7eae5f21447f4d9aad5226db49;hpb=c818441c4f4cf654d0f34c8f58e70b029f37a43f diff --git a/src/gameview.cpp b/src/gameview.cpp index 2f70c51..2089637 100644 --- a/src/gameview.cpp +++ b/src/gameview.cpp @@ -83,11 +83,11 @@ void GameView::setPieces(const QList pieces) int horizontalCount = 0; // Find out board size - if(pieces_.count() == 12) { - horizontalCount = 4; + if(pieces_.count() == EASY_PIECE_COUNT) { + horizontalCount = EASY_HORIZONTAL_COUNT; } - else if(pieces_.count() == 20) { - horizontalCount = 5; + else if(pieces_.count() == HARD_PIECE_COUNT) { + horizontalCount = HARD_HORIZONTAL_COUNT; } else { qDebug() << "Invalid piece count @ GameView::setPieces"; @@ -109,11 +109,12 @@ void GameView::setPieces(const QList pieces) pieces_.at(pieceNumber)->setPos(point); pieces_.at(pieceNumber)->setCorrectPlace(point); pieces_.at(pieceNumber)->setCurrentPlace(point); + pieces_.at(pieceNumber)->setDrawNumber(true); pieceNumber++; } } - // Wait a second + // Wait QTimer::singleShot(750, this, SLOT(shufflePieces())); } @@ -186,9 +187,10 @@ bool GameView::areAllPiecesOk() const pieces_.at(hiddenIndex_)->show(); pieces_.at(hiddenIndex_)->moveMeTo(emptyPlace_); - // Set all pieces not movable + // Set all pieces not movable and hide numbers for(int i = 0; i < pieces_.count(); ++i) { pieces_.at(i)->setMovable(false); + pieces_.at(i)->setDrawNumber(false); } // Show dialog with move count