public void SaveGameSession(GameSessionHistory score) { if (score.GamesPlayed < Preferences.Get <int> (Preferences.MinPlayedGamesKey)) { last_game = -1; return; } if (Games.Count >= Preferences.Get <int> (Preferences.MaxStoredGamesKey)) { Games.RemoveAt(0); } // Storing a copy to allow the input object to be modified Games.Add(score.Copy()); last_game = Games.Count - 1; Save(); }
public void SaveGameSession(GameSessionHistory score) { if (score.GamesPlayed < Preferences.Get <int> (Preferences.MinPlayedGamesKey)) { last_game = -1; return; } if (Games.Count >= Preferences.Get <int> (Preferences.MaxStoredGamesKey)) Games.RemoveAt (0); // Storing a copy to allow the input object to be modified Games.Add (score.Copy ()); last_game = Games.Count - 1; Save (); }