コード例 #1
0
        public void BattleshipsMenu()
        {
            bool running = true;

            do
            {
                Console.WriteLine("Battle Ships Menu \n");
                Console.WriteLine("1. Start new game \n2. Deploy ship. \n0. Exit ");
                string choice = GetUserChoice();
                switch (choice)
                {
                case "1":
                    Console.Clear();
                    battleships = new Battleships();
                    battleships.Skifttur();
                    Console.WriteLine(battleships.GetBoardView(battleships.board, battleships.board2));
                    break;

                case "2":
                    DeployMenu();
                    battleships.Skifttur();
                    Console.WriteLine(battleships.GetBoardView(battleships.board, battleships.board2));
                    break;

                case "0": running = false; break;

                default: ShowMenuSelectionError(); break;
                }
            } while (running);
        }