From 656c4e7a8efb0d7f515f635e3f063b2377e06f58 Mon Sep 17 00:00:00 2001 From: Claudio Schaad Date: Tue, 24 Feb 2026 20:25:20 +0100 Subject: [PATCH] feat: add ResetStatisticsAsync to GameService --- MemoryGame/Services/GameService.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/MemoryGame/Services/GameService.cs b/MemoryGame/Services/GameService.cs index 2d06071..c5aacb6 100644 --- a/MemoryGame/Services/GameService.cs +++ b/MemoryGame/Services/GameService.cs @@ -165,4 +165,18 @@ public sealed class GameService { return _statistics?.Words ?? []; } + + public async Task ResetStatisticsAsync() + { + if (_statistics == null) + return; + + foreach (var word in _statistics.Words) + { + word.CorrectCount = 0; + word.IncorrectCount = 0; + } + + await _localStorage.SaveStatisticsAsync(_statistics); + } }