summaryrefslogtreecommitdiff
path: root/Penguloon/UserdataManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Penguloon/UserdataManager.cs')
-rw-r--r--Penguloon/UserdataManager.cs11
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))
{