|
|
@ -8,11 +8,14 @@ void MainWindow::buttonPressed(int row, int column) {
|
|
|
|
QString text = "\u2605";
|
|
|
|
QString text = "\u2605";
|
|
|
|
std::set<std::vector<int>> connected;
|
|
|
|
std::set<std::vector<int>> connected;
|
|
|
|
game->getConnected(&connected, game->getCell(row, column), row, column);
|
|
|
|
game->getConnected(&connected, game->getCell(row, column), row, column);
|
|
|
|
if ( connected.size() > 1)
|
|
|
|
if ( connected.size() > 1) {
|
|
|
|
|
|
|
|
int n = connected.size();
|
|
|
|
|
|
|
|
int new_score = ui->lcdScore->intValue() + (n * (n-1));
|
|
|
|
|
|
|
|
ui->lcdScore->display(new_score);
|
|
|
|
for (auto i = connected.begin(); i != connected.end(); i++) {
|
|
|
|
for (auto i = connected.begin(); i != connected.end(); i++) {
|
|
|
|
buttonGrid[(*i)[0]][(*i)[1]]->setText(text);
|
|
|
|
buttonGrid[(*i)[0]][(*i)[1]]->setText(text);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
} else
|
|
|
|
ui->statusBar->showMessage("Only friends get Stars!", 2000);
|
|
|
|
ui->statusBar->showMessage("Only friends get Stars!", 2000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|