Copy() public method

public Copy ( ) : GameSessionHistory
return GameSessionHistory
Beispiel #1
0
        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();
        }
Beispiel #2
0
        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 ();
        }