works
authorConstantin <constantin@exxxtremesys.lu>
Fri, 19 Jul 2013 15:54:52 +0000 (17:54 +0200)
committerConstantin <constantin@exxxtremesys.lu>
Fri, 19 Jul 2013 15:54:52 +0000 (17:54 +0200)
qt/multypo.cpp

index 1667c0fcd87e1107e54018714bee1b0490f53ca9..8dea3e025abeea2b8ca1aa2aaa25dbd7d64d741e 100644 (file)
@@ -44,8 +44,11 @@ void MultypoWindow::nextWord() {
        QByteArray tmp = words.readLine().trimmed();
        QString word = QString::fromUtf8(tmp);
        if (word.isEmpty()) { // game over
        QByteArray tmp = words.readLine().trimmed();
        QString word = QString::fromUtf8(tmp);
        if (word.isEmpty()) { // game over
-               qDebug() << "TODO: implement gameover";
-               exit (0);
+               mainLabel->setText("GAME OVER");
+               for (QMap<int, Player*>::Iterator it = players.begin(); it != players.end(); ++it) {
+                       QString tmp = QString ("Spieler %1 hat %2 Punkte.").arg(it.value()->getName()).arg(it.value()->score);
+                       it.value()->setWaiting(tmp);
+               }
        } else {
                resetPlayerText();
                mainLabel->setText(word);
        } else {
                resetPlayerText();
                mainLabel->setText(word);