Copy() public method

public Copy ( ) : GameSessionHistory
return GameSessionHistory
コード例 #1
0
ファイル: PlayerHistory.cs プロジェクト: isabella232/gbrainy
        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();
        }
コード例 #2
0
ファイル: PlayerHistory.cs プロジェクト: GNOME/gbrainy
        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 ();
        }