feat: add ResetStatisticsAsync to GameService
This commit is contained in:
parent
b607cd5594
commit
656c4e7a8e
1 changed files with 14 additions and 0 deletions
|
|
@ -165,4 +165,18 @@ public sealed class GameService
|
||||||
{
|
{
|
||||||
return _statistics?.Words ?? [];
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue