示例#1
0
        static void DisplaySpaceMonster(SpaceMonster spaceMonster)
        {
            Console.ForegroundColor = ConsoleColor.White;

            DisplayHeader("Monster Info");

            Console.WriteLine(">> Space Monster");
            Console.WriteLine();
            Console.WriteLine($"Id: {spaceMonster.Id}");
            Console.WriteLine();
            Console.WriteLine($"Name: {spaceMonster.Name}");
            Console.WriteLine();
            Console.WriteLine($"Age: {spaceMonster.Age} Years Old");
            Console.WriteLine();
            Console.WriteLine($"Is Active: {(spaceMonster.IsActive ? "Yes" : "No")}");
            Console.WriteLine();
            Console.WriteLine($"Is Happy: {(spaceMonster.IsHappy() ? "Yes" : "No")}");
            Console.WriteLine();
            Console.WriteLine($"Is Hungry: {(spaceMonster.IsHungry() ? "Yes" : "No")}");
            Console.WriteLine();
            Console.WriteLine($"Has Spaceship: {(spaceMonster.HasSpaceShip ? "Yes" : "No")}");
            Console.WriteLine();

            spaceMonster.Greeting();

            Console.WriteLine($"You attack {spaceMonster.Name}, and they {spaceMonster.MonsterBattleResponse()}");
            Console.WriteLine();

            spaceMonster.Farewell();

            Console.ReadKey();

            Console.Clear();
        }
示例#2
0
        static void DisplayMonsterInfoScreen(SeaMonster seaMonster, SpaceMonster spaceMonster, LavaMonster lavaMonster)
        {
            DisplayHeader("Monster Info");

            DisplaySeaMonster(seaMonster);

            Console.WriteLine();

            DisplaySpaceMonster(spaceMonster);

            Console.WriteLine();

            DisplayLavaMonster(lavaMonster);

            Console.WriteLine();


            DisplayContinuePrompt();
        }
示例#3
0
        private static void DisplayMenu()
        {
            DisplayHeader("Menu");
            bool exiting = false;

            string       menuchoice;
            SeaMonster   Lannerbeck = InitializeSeaMonster();
            SpaceMonster Yngwie     = InitializeSpaceMonster();
            LavaMonster  Johannes   = InitializeLavaMonster();

            while (!exiting)
            {
                Console.ForegroundColor = ConsoleColor.Blue;
                DisplayHeader("Main Menu");
                Console.WriteLine();
                Console.WriteLine("1) Display Monsters");
                Console.WriteLine();
                Console.WriteLine("2) Exit");
                Console.WriteLine();
                Console.WriteLine("Enter Choice");
                Console.WriteLine();
                menuchoice = Console.ReadLine();

                switch (menuchoice)
                {
                case "1": Console.Clear();
                    DisplayMonsterInfoScreen(Lannerbeck, Yngwie, Johannes);
                    break;

                case "2": exiting = true;
                    break;

                default:
                    Console.Clear();
                    Console.WriteLine("Please enter a valid choice");
                    DisplayContinuePrompt();
                    Console.Clear();
                    break;
                }
            }
        }