Ejemplo n.º 1
0
 private static void DisplayForestMonster(ForestMonster forestMonster)
 {
     Console.WriteLine($"Id: {forestMonster.ID}");
     Console.WriteLine($"Name: {forestMonster.Name}");
     Console.WriteLine($"Age: {forestMonster.Age}");
     Console.WriteLine($"Active: {(forestMonster.IsActive ? "Yes" : "No")}");
     Console.WriteLine($"Has Horns: {(forestMonster.HasHorns ? "Yes" : "No")}");
     forestMonster.Greeting();
     forestMonster.IsHappy();
     Console.WriteLine($"You hug {forestMonster.Name} and they {forestMonster.MonsterHugResponse()}");
 }
Ejemplo n.º 2
0
        static void DisplayMenu()
        {
            bool exitMenu = false;

            SeaMonster    suzy  = InitializeSeaMonster();
            SpaceMonster  sid   = InitializeSpaceMonster();
            ForestMonster sammy = InitializeForestMonster();

            do
            {
                DisplayHeader("Menu");
                Console.WriteLine("1) Display Monsters");
                Console.WriteLine("2) Exit");
                Console.WriteLine("3) Add a Sea Monster");
                Console.Write("Enter Choice:");
                int userChoice = int.Parse(Console.ReadLine());

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

                case 2:
                    exitMenu = true;
                    break;

                case 3:
                    CreateSeaMonster(suzy);
                    break;

                default:
                    Console.WriteLine("Please enter a valid choice.");
                    DisplayContinuePrompt();
                    break;
                }
            } while (!exitMenu);
        }
Ejemplo n.º 3
0
        static void DisplayMonsterInfoScreen(SeaMonster seaMonster, SpaceMonster spaceMonster, ForestMonster forestMonster)
        {
            DisplayHeader("Monster Information");

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

            DisplayContinuePrompt();
        }