Beispiel #1
0
        static void DisplayMonsterInfoScreen(SeaMonster seaMonster, SpaceMonster spaceMonster)
        {
            DisplayHeader("Monster Information");

            DisplaySeaMonster(seaMonster);
            Console.WriteLine();
            DisplaySpaceMonster(spaceMonster);

            DisplayContinuePrompt();
        }
Beispiel #2
0
        private static void DisplaySpaceMonster(SpaceMonster spaceMonster)
        {
            Console.WriteLine($"Id: {spaceMonster.ID}");
            Console.WriteLine($"Name: {spaceMonster.Name}");
            Console.WriteLine($"Age: {spaceMonster.Age}");
            Console.WriteLine($"Active: {(spaceMonster.IsActive ? "Yes" : "No")}");

            spaceMonster.Greeting();
            Console.WriteLine($"You attack {spaceMonster.Name} and they {spaceMonster.MonsterBattleResponses()}");
        }
Beispiel #3
0
        static void DisplayMenu()
        {
            bool         exitMenu = false;
            SeaMonster   suzy     = InitializeSeaMonster();
            SpaceMonster john     = InitializeSpaceMonster();

            DisplayHeader("Menu");

            do
            {
                Console.WriteLine("1)Display Monster");
                Console.WriteLine("2)Exit");
                Console.WriteLine("Enter Choice");
                int userChoice = 0;

                while (!int.TryParse(Console.ReadLine(), out userChoice))
                {
                    Console.WriteLine("Please Enter a valid choice!");
                }
                ;

                switch (userChoice)
                {
                case 1:
                    DisplayMonsterInfoScreen(suzy, john);
                    break;

                case 2:
                    exitMenu = true;
                    break;

                default:
                    Console.WriteLine("Please enter a valid choice");
                    break;
                }
            } while (!exitMenu);
        }