コード例 #1
0
        static public int RunChoice()
        {
            var choice = Console.ReadLine();

            Console.Clear();
            switch (choice)
            {
            case "1":
            {
                CreateNewLeague();
                break;
            }

            case "2":
            {
                if (!CheckPlayerNumber())
                {
                    break;
                }
                ChooseWinners();
                break;
            }

            case "3":
            {
                _scoreboard.Print();
                break;
            }

            case "4":
            {
                Environment.Exit(0);
                break;
            }

            default:
            {
                Console.Clear();
                Console.WriteLine("Please, press the appropriate button according to the menu!");
                PrintMenu();
                return(0);
            }
            }
            return(1);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: medegor44/Students
        public static int RunChoice()
        {
            var choice = ConsoleWorker.MenuChoice();

            switch (choice)
            {
            case "1":
            {
                CreateNewLeague();
                break;
            }

            case "2":
            {
                if (!CheckPlayerNumber())
                {
                    break;
                }
                ChooseWinners();
                break;
            }

            case "3":
            {
                _scoreboard.Print();
                break;
            }

            case "4":
            {
                Environment.Exit(0);
                break;
            }

            default:
            {
                ConsoleWorker.IncorrectMenuChoice();
                ConsoleWorker.Menu();
                return(0);
            }
            }
            return(1);
        }