예제 #1
0
        public static string ShowPlayerScore(string name, int score)
        {
            string user = "";

            foreach (var playerName in UserHighScores)
            {
                if (playerName.Key == null)
                {
                    nameCount++;
                    UserHighScores.Add(name, score);
                    return(user += $"{name} {score}");
                }
                else if (playerName.Key != name)
                {
                    nameCount++;
                    UserHighScores.Add(name, score);
                    return(user += $"{name} {score}");
                }
                else
                {
                    nameCount++;
                    UserHighScores.Add(name + $"{nameCount}", score);
                    return(user += $"{name} {score}");
                }
            }
            return(user);
        }
예제 #2
0
 public static void SeedScores()
 {
     UserHighScores.Add("AAA", 10);
     UserHighScores.Add("BBB", 10);
     UserHighScores.Add("CCC", 10);
     UserHighScores.Add("DDD", 10);
     UserHighScores.Add("EEE", 10);
 }