diff options
| author | aldrikboy <aldrikboy@gmail.com> | 2018-01-13 21:40:10 +0100 |
|---|---|---|
| committer | aldrikboy <aldrikboy@gmail.com> | 2018-01-13 21:40:10 +0100 |
| commit | 8f50205e10a84ec88bc1c192a4e556a9a593b7f7 (patch) | |
| tree | 51a338af7a1553e2f49f3c0e9ff8a9e76a012b9e /Penguloon/UserdataManager.cs | |
| parent | 8a4eb6a05b95290cc1d8f26b8c285d391f37fe4e (diff) | |
stats reset btn
Diffstat (limited to 'Penguloon/UserdataManager.cs')
| -rw-r--r-- | Penguloon/UserdataManager.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Penguloon/UserdataManager.cs b/Penguloon/UserdataManager.cs index f3c5aa5..bdbea57 100644 --- a/Penguloon/UserdataManager.cs +++ b/Penguloon/UserdataManager.cs @@ -30,12 +30,19 @@ namespace Penguloon } } - public static void ReadData(Context context) + public static void ReadData(Context context, bool reset = false) { File file = new File(context.CacheDir, "userdata.txt"); - if (!file.Exists()) + if (!file.Exists() || reset) + { + TotalKills = 0; + TotalMoneySpent = 0; + GamesPlayed = 0; + HighestRound = 0; + HighestKills = 0; WriteData(context); + } using (var streamReader = new System.IO.StreamReader(file.AbsolutePath, true)) { |
