public void highscore_cleared_highscore_is_empty() { var highScores = new HighScores(); for (int i = 0; i < 20; i++) { highScores.Add(new Score(i)); } highScores.Clear(); CollectionAssert.IsEmpty(highScores); }
public void highscore_cleared_highscore_is_empty() { var highScores = new HighScores(); for (int i = 0; i < 20; i++) { highScores.Add(new Score(i.ToString(CultureInfo.InvariantCulture), i)); } highScores.Clear(); CollectionAssert.IsEmpty(highScores); }
private void SetScoreInfo(ScoreInfo scoreInfo) { var lastScoreInfo = currentScoreInfo; currentScoreInfo = scoreInfo; lastTime = 0; dispatcher.Invoke((Action)(() => { ResetZoom(); HighScores.Clear(); WebHighScores.Clear(); HighScores.Add(new KeyValuePair <DateTime, int>(XMinimum, scoreInfo.UserHighScore)); HighScores.Add(new KeyValuePair <DateTime, int>(XMaximum, scoreInfo.UserHighScore)); WebHighScores.Add(new KeyValuePair <DateTime, int>(XMinimum, scoreInfo.WebHighScore)); WebHighScores.Add(new KeyValuePair <DateTime, int>(XMaximum, scoreInfo.WebHighScore)); Score = CoolCount = GoodCount = SafeCount = SadCount = WorstCount = 0; UserHighScore = scoreInfo.UserHighScore; WebHighScore = scoreInfo.WebHighScore; ScoreName = currentScoreInfo.ScoreName; Difficulty = currentScoreInfo.Difficulty; if (lastScoreInfo != null && lastScoreInfo.ScoreHashAsString != currentScoreInfo.ScoreHashAsString) { BestScores = null; bestResult = ExpansionDatabase.Instance.FindResult(currentScoreInfo.ScoreHashAsString); if (bestResult != null) { BestScores = new ObservableCollection <KeyValuePair <DateTime, int> >(bestResult.Data); } Scores.Clear(); Results.Clear(); } else { if (isBestScore) { BestScores = Scores; bestResultInfo = currentResultInfo; } Scores = new ObservableCollection <KeyValuePair <DateTime, int> >(); } isBestScore = false; UpdateScorePercent(); })); }
public void Clear() { m_highScores.Clear(); NotifyListeners(); }
private void OnDisable() { HighScores.Clear(); StopCoroutine(NewScoreAsync()); }