summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/zsame/StoneField.cpp4
-rw-r--r--noncore/games/zsame/StoneField.h3
-rw-r--r--noncore/games/zsame/StoneWidget.cpp4
-rw-r--r--noncore/games/zsame/StoneWidget.h1
-rw-r--r--noncore/games/zsame/ZSameWidget.cpp1
5 files changed, 12 insertions, 1 deletions
diff --git a/noncore/games/zsame/StoneField.cpp b/noncore/games/zsame/StoneField.cpp
index 49d8eca..56e9dc5 100644
--- a/noncore/games/zsame/StoneField.cpp
+++ b/noncore/games/zsame/StoneField.cpp
@@ -353,4 +353,8 @@ bool StoneField::gotBonus() const {
}
+void StoneField::clearBonus() {
+ m_gotBonus = false;
+}
+
int
StoneField::getBoard() const {
diff --git a/noncore/games/zsame/StoneField.h b/noncore/games/zsame/StoneField.h
index 80be73a..d32d78d 100644
--- a/noncore/games/zsame/StoneField.h
+++ b/noncore/games/zsame/StoneField.h
@@ -92,6 +92,7 @@ public:
int undo(int count=1);
- bool isGameover() const;
+ bool isGameover() const;
bool gotBonus() const;
+ void clearBonus();
bool undoPossible() const;
int getBoard() const;
diff --git a/noncore/games/zsame/StoneWidget.cpp b/noncore/games/zsame/StoneWidget.cpp
index 646fc9c..5dd0252 100644
--- a/noncore/games/zsame/StoneWidget.cpp
+++ b/noncore/games/zsame/StoneWidget.cpp
@@ -186,4 +186,8 @@ bool StoneWidget::hasBonus() {
}
+void StoneWidget::clearBonus() {
+ stonefield.clearBonus();
+}
+
bool StoneWidget::isOriginalBoard() {
return !modified;
diff --git a/noncore/games/zsame/StoneWidget.h b/noncore/games/zsame/StoneWidget.h
index 9cd7e10..89a8afc 100644
--- a/noncore/games/zsame/StoneWidget.h
+++ b/noncore/games/zsame/StoneWidget.h
@@ -72,4 +72,5 @@ public:
// if isGameover(): finished with bonus?
bool hasBonus();
+ void clearBonus();
// test for unchanged start position
bool isOriginalBoard();
diff --git a/noncore/games/zsame/ZSameWidget.cpp b/noncore/games/zsame/ZSameWidget.cpp
index 04ad825..dee4a1c 100644
--- a/noncore/games/zsame/ZSameWidget.cpp
+++ b/noncore/games/zsame/ZSameWidget.cpp
@@ -219,4 +219,5 @@ void ZSameWidget::gameover() {
i18n("<qt>You even removed the last stone, great job! "
"This gave you a score of %1 in total.</qt>").arg(stone->score()));
+ stone->clearBonus();
} else {
QMessageBox::information(this,i18n("Game over"),