Final changes

This commit is contained in:
KaseToatz1337
2024-11-11 11:28:17 +01:00
parent 4c01b5ae79
commit 83efd9de1f
5 changed files with 24 additions and 27 deletions

View File

@ -102,7 +102,7 @@ namespace Memory.Cmd
// Print the players score to the console then loop over highscores to print those aswell
Console.WriteLine($"Your score: {game.Scoring.Points}\nTop 10 Highscores:");
List<Score> highscores = game.ScoreHandler.GetTopScores();
for (int i = 0; i < highscores.Count; i++)
for (int i = 0; i < Math.Min(Game.LEADERBOARDSIZE, highscores.Count); i++)
{
Score score = highscores[i];
Console.WriteLine($"{i+1}. {score.Name}: {score.Points}");