public static SharedClasses Instance() { if (_instance == null) { _instance = new SharedClasses(); } return(_instance); }
// Load rounds played, words solved and score public void Load() { RoundsPlayed = SharedClasses.Instance().AppClass.LoadPref <int>("RoundsPlayed"); WordsSolved = SharedClasses.Instance().AppClass.LoadPref <int>("WordsSolved"); TotalScore = SharedClasses.Instance().AppClass.LoadPref <int>("TotalScore"); }
// Increment and save total score public void AddTotalScore(int value) { TotalScore += value; SharedClasses.Instance().AppClass.SavePref <int>("TotalScore", TotalScore); Debug.WriteLine("TotalScore " + TotalScore); }
// Increment and save words solved public void AddWordsSolved(int value) { WordsSolved += value; SharedClasses.Instance().AppClass.SavePref <int>("WordsSolved", WordsSolved); Debug.WriteLine("WordsSolved " + WordsSolved); }
// Increment and save rounds played public void IncrementRoundsPlayed() { RoundsPlayed++; SharedClasses.Instance().AppClass.SavePref <int>("RoundsPlayed", RoundsPlayed); Debug.WriteLine("RoundsPlayed " + RoundsPlayed); }
// Load Player Preferences public void Load() { ThemeIndex = SharedClasses.Instance().AppClass.LoadPref <int>("ThemeIndex"); }