I'm currently working on a networked game of pong. Once the game has ended, the player name and score will be sent to the server for storage. The player is able to access these highscores from the main menu.
Once there are 5 scores stored on the server, only scores that are beat the currently stored scores are added to the database.
Highscores are stored in a dictionary(string, int) and are then ordered by value.
I'm struggling to create a method which will take a highscore entry(name, score), and check it against the highscores dictionary. if the score is high enough, the dictionary will be reordered and will include the new value.