示例#1
0
        public void AddScore(int score)
        {
            if (_scores.Count < _scoreBlocks.Length || score > _scores.Min(o=>o.Value))
            {
                NameDialog nameDialog = new NameDialog();
                if (nameDialog.ShowDialog() == true)
                {
                    string name = nameDialog.Result;
                    _scores.Add(new Score
                    {
                        Name = name,
                        Value = score
                    });
                }
            }

            Settings.Default.HighScores = string.Join(",", _scores.OrderByDescending(o=>o.Value).Take(_scoreBlocks.Length));
            Settings.Default.Save();

            Update();
        }
示例#2
0
        public void AddScore(int score)
        {
            if (_scores.Count < _scoreBlocks.Length || score > _scores.Min(o=>o.Value))
            {
                NameDialog nameDialog = new NameDialog();
                if (nameDialog.ShowDialog() == true)
                {
                    string name = nameDialog.Result;
                    _scores.Add(new Score
                    {
                        Name = name,
                        Value = score
                    });
                }
            }

            Settings.Default.HighScores = string.Join(",", _scores.OrderByDescending(o=>o.Value).Take(_scoreBlocks.Length));
            Settings.Default.Save();

            Update();
        }