Exemplo n.º 1
0
        static void DisplayMonsterInfoScreen(SeaMonster seaMonster, SpaceMonster spaceMonster)
        {
            DisplayHeader("Monster Information");

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

            DisplayContinuePrompt();
        }
Exemplo n.º 2
0
        private static void DisplaySeaMonster(SeaMonster seaMonster)
        {
            Console.WriteLine($"Id: {seaMonster.ID}");
            Console.WriteLine($"Name: {seaMonster.Name}");
            Console.WriteLine($"Age: {seaMonster.Age}");
            Console.WriteLine($"Active: {(seaMonster.IsActive ? "Yes" : "No")}");
            Console.WriteLine($"Has Gills: {(seaMonster.HasGills ? "Yes" : "No")}");
            Console.WriteLine($"Is the Monster Happy: {(seaMonster.IsHappy())}");
            Console.WriteLine($"Nickname: {seaMonster.Nickname}");
            Console.WriteLine($"Casualty: {seaMonster.Casualties}");
            Console.WriteLine($"People Friendly:{(seaMonster.LikesHumans ? "Yes" : "No")}");



            seaMonster.Greeting();
            Console.WriteLine($"You attack {seaMonster.Name} and they {seaMonster.MonsterBattleResponses()}");
        }
Exemplo n.º 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);
        }