Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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();
            }));
        }
Ejemplo n.º 4
0
    public void Clear()
    {
        m_highScores.Clear();

        NotifyListeners();
    }
Ejemplo n.º 5
0
 private void OnDisable()
 {
     HighScores.Clear();
     StopCoroutine(NewScoreAsync());
 }