1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:27:46 +00:00

Solitaire: Only update high score after a victorious game

Doesn't make much sense to update the high score on a lost game.
This commit is contained in:
Timothy Flynn 2021-05-25 11:44:25 -04:00 committed by Andreas Kling
parent 95401d2ca2
commit 0b30a0febb
3 changed files with 14 additions and 9 deletions

View file

@ -21,6 +21,11 @@ enum class Mode : u8 {
__Count
};
enum class GameOverReason {
Victory,
NewGame,
};
class Game final : public GUI::Frame {
C_OBJECT(Game)
public:
@ -34,7 +39,7 @@ public:
Function<void(uint32_t)> on_score_update;
Function<void()> on_game_start;
Function<void()> on_game_end;
Function<void(GameOverReason, uint32_t)> on_game_end;
private:
Game();