Implement possibilty to reopen game
This commit is contained in:
@@ -247,17 +247,23 @@ class GameSession extends ChangeNotifier {
|
|||||||
List<int> updatePoints() {
|
List<int> updatePoints() {
|
||||||
List<int> bonusPlayers = [];
|
List<int> bonusPlayers = [];
|
||||||
_sumPoints();
|
_sumPoints();
|
||||||
|
bool limitExceeded = false;
|
||||||
|
|
||||||
if (isPointsLimitEnabled) {
|
if (isPointsLimitEnabled) {
|
||||||
bonusPlayers = _checkHundredPointsReached();
|
bonusPlayers = _checkHundredPointsReached();
|
||||||
|
|
||||||
for (int i = 0; i < playerScores.length; i++) {
|
for (int i = 0; i < playerScores.length; i++) {
|
||||||
if (playerScores[i] > pointLimit) {
|
if (playerScores[i] > pointLimit) {
|
||||||
isGameFinished = true;
|
isGameFinished = true;
|
||||||
|
limitExceeded = true;
|
||||||
print('${players[i]} hat die 100 Punkte ueberschritten, '
|
print('${players[i]} hat die 100 Punkte ueberschritten, '
|
||||||
'deswegen wurde das Spiel beendet');
|
'deswegen wurde das Spiel beendet');
|
||||||
setWinner();
|
setWinner();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!limitExceeded) {
|
||||||
|
isGameFinished = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
return bonusPlayers;
|
return bonusPlayers;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: cabo_counter
|
|||||||
description: "Mobile app for the card game Cabo"
|
description: "Mobile app for the card game Cabo"
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
|
|
||||||
version: 0.5.3+596
|
version: 0.5.3+597
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.4
|
sdk: ^3.5.4
|
||||||
|
|||||||
Reference in New Issue
Block a user