From 5373e919a0d9e389fc2076963f610d044c21ccb5 Mon Sep 17 00:00:00 2001 From: aldrikboy Date: Fri, 29 Dec 2017 00:32:34 +0100 Subject: level implementation XDDDDDDDd --- Penguloon/UserdataManager.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Penguloon/UserdataManager.cs') diff --git a/Penguloon/UserdataManager.cs b/Penguloon/UserdataManager.cs index 872ab1d..eca3580 100644 --- a/Penguloon/UserdataManager.cs +++ b/Penguloon/UserdataManager.cs @@ -15,6 +15,8 @@ namespace Penguloon public static int HighestRound { get; set; } public static int HighestKills { get; set; } + public static int Level { get; set; } + public static void WriteData(Context context) { File file = new File(context.CacheDir, "userdata.txt"); @@ -46,5 +48,19 @@ namespace Penguloon HighestKills = int.Parse(lines[4]); } } + + public static int GetLevel() + { + for (int i = 0; i < 999; i++) + { + int killsNeeded = (int)((i * 50) * (i * 1.1)); + + if (TotalKills > killsNeeded) continue; + + return i; + } + + return 0; + } } } \ No newline at end of file -- cgit v1.2.3-70-g09d2