public static void RunHighscore() { bool again = true; while (again) { Console.Clear(); HighscoreList.RunHighScoreAll(); HighscoreList.TextMenuHighscores(); int choice = InputNumber(0, 4); switch (choice) { case 1: Console.Clear(); HighScoreEachGame.OpenHighscores("highscoresnake.txt", HighScoreEachGame.ListSnake); HighscoreList.PrintHighscoreEachGame("SNAKE", HighScoreEachGame.ListSnake); Console.WriteLine(); Console.WriteLine("\t\tTryck valfri knapp för att återgå till menyn."); Console.ReadKey(true); break; case 2: Console.Clear(); HighScoreEachGame.OpenHighscores("yatzyhighscorelist.txt", HighScoreEachGame.ListYatzy); HighscoreList.PrintHighscoreEachGame("YATZY", HighScoreEachGame.ListYatzy); Console.WriteLine(); Console.WriteLine("\t\tTryck valfri knapp för att återgå till menyn."); Console.ReadKey(true); break; case 3: Console.Clear(); HighScoreEachGame.OpenHighscores("flappybirdhighscore.txt", HighScoreEachGame.ListFlappyBird); HighscoreList.PrintHighscoreEachGame("FLAPPY BIRD", HighScoreEachGame.ListFlappyBird); Console.WriteLine(); Console.WriteLine("\t\tTryck valfri knapp för att återgå till menyn."); Console.ReadKey(true); break; case 4: Console.Clear(); HighScoreEachGame.OpenAndPrintHighscore(); Console.WriteLine("\t\tTryck valfri knapp för att återgå till menyn."); Console.ReadKey(true); break; case 0: again = false; break; default: break; } } }
public static void RunHighScoreAll() { Console.Clear(); Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine("\n\n\n\t\tHIGHSCORE - LISTA: Högsta poäng för respektive spel!"); Console.WriteLine("\t\t******************"); Console.ForegroundColor = ConsoleColor.DarkCyan; HighscoreList highscore = new HighscoreList(); highscore.ShowAllHighScore(); Console.WriteLine(); }