Example #1
0
        static void DisplayMenu(SeaMonster mySeaMonster, SpaceMonster mySpaceMonster)
        {
            bool exitMenu = false;
            int  menuSelection;

            do
            {
                Console.Clear();
                DisplayHeader("Menu");
                Console.WriteLine("1) Display Monsters");
                Console.WriteLine("2) Exit");
                Console.WriteLine();
                Console.Write("Enter Selection:");
                menuSelection = int.Parse(Console.ReadLine());

                switch (menuSelection)
                {
                case 1:
                    DisplayMonsterInfoScreen(mySeaMonster, mySpaceMonster);
                    break;

                case 2:
                    exitMenu = true;
                    break;

                default:
                    Console.WriteLine("Please enter a proper selection.");
                    DisplayContinuePrompt();
                    break;
                }
            } while (!exitMenu);
        }
        private static void DisplayFightingSpaceMonster(SpaceMonster spaceMonster)
        {
            DisplayHeader("Fighting Jaal");

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

            DisplayContinuePrompt();
        }
Example #3
0
        private static void DisplaySpaceMonster(SpaceMonster spaceMonster)
        {
            Console.WriteLine($"Id: {spaceMonster.Id}");
            Console.WriteLine($"Name: {spaceMonster.Name}");
            Console.WriteLine($"Age: {spaceMonster.Age}");
            Console.WriteLine($"Galaxy: {spaceMonster.Galaxy}");
            Console.WriteLine($"Is Happy: {spaceMonster.IsHappy()}");

            Console.WriteLine($"You Attacked {spaceMonster.Name} and they {spaceMonster.MonsterBattleResponse()} in response");
        }
Example #4
0
        private static void DisplaySpaceMonsterInfo(SpaceMonster spaceMonster)
        {
            Console.WriteLine($"Id: {spaceMonster.id}");
            Console.WriteLine($"name: {spaceMonster.name}");
            Console.WriteLine($"age: {spaceMonster.age}");
            Console.WriteLine($"galaxy: {spaceMonster.Galaxy}");
            Console.WriteLine($"Is happy: {(spaceMonster.IsHappy() ? "yes" : "no")}");

            Console.WriteLine($"you attacked {spaceMonster.name} and they {spaceMonster.MonsterBattleResponse()}");
        }
 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")}");
     Console.WriteLine($"Has Spaceship: {(spaceMonster.HasSpaceShip ? "Yes" : "No")}");
     spaceMonster.Greeting();
     spaceMonster.IsHappy();
     Console.WriteLine($"You attack {spaceMonster.Name} and they {spaceMonster.MonsterBattleResponse()}");
 }
        private static void DisplaySpaceMonsterInfo(SpaceMonster spaceMonster)
        {
            Console.WriteLine($"Id: {spaceMonster.Id}");
            Console.WriteLine($"Name: {spaceMonster.Name}");
            Console.WriteLine($"Age: {spaceMonster.Age}");
            Console.WriteLine($"Galaxy: {spaceMonster.Galaxy}");
            Console.WriteLine($"Is Happy: {(spaceMonster.IsHappy() ? "yes" : "no")}");
            Console.WriteLine($"Color: {spaceMonster.Color}");

            Console.WriteLine($"You attacked {spaceMonster.Name} and they {spaceMonster.MonsterBattleResponse()}");
        }
Example #7
0
        static List <SpaceMonster> DisplaySpaceMonsterEditingMenu(List <SpaceMonster> AllSpaceMonsters)
        {
            int  userChoice;
            bool loop = true;

            do
            {
                do
                {
                    DisplayHeader("SPACE MONSTER EDITING MENU");
                    Console.WriteLine();

                    LeftJustifyText(" 1) View All Space Monsters", 63);
                    LeftJustifyText(" 2) Add New", 63);
                    LeftJustifyText(" 3) Edit", 63);
                    LeftJustifyText(" 4) Delete", 63);
                    LeftJustifyText(" 5) Return to Monster Editing Menu", 63);

                    CenterText(" Please type your selection's number, then press enter. ", 57);
                } while (!int.TryParse(Console.ReadLine(), out userChoice) && userChoice > 0 && userChoice <= 5);

                switch (userChoice)
                {
                case 1:
                    DisplayHeader("Space Monster Info");
                    DisplaySpaceMonsterInfo(AllSpaceMonsters);
                    DisplayUserPause("continue");
                    break;

                case 2:
                    SpaceMonster userSpaceMonster = DisplayAddNewSpaceMonster();
                    AllSpaceMonsters.Add(userSpaceMonster);
                    break;

                case 3:
                    AllSpaceMonsters = DisplayEditSpaceMonster(AllSpaceMonsters);

                    break;

                case 4:
                    AllSpaceMonsters = DisplayDeleteSpaceMonster(AllSpaceMonsters);
                    break;

                case 5:
                    loop = false;
                    break;
                }
            } while (loop);



            return(AllSpaceMonsters);
        }
Example #8
0
 private static void DisplaySpaceMonsterInfo(SpaceMonster spaceMonster)
 {
     Console.WriteLine($"Id: {spaceMonster.Id}");
     Console.WriteLine($"Name: {spaceMonster.Name}");
     Console.WriteLine($"Age: {spaceMonster.Age}");
     Console.WriteLine($"Galaxy: {spaceMonster.Galaxy}");
     Console.WriteLine($"Is Happy: {(spaceMonster.IsHappy() ? "yes" : "no") }");
     Console.WriteLine($"Toughness: {spaceMonster.Toughness}");
     Console.WriteLine($"Ferociousness: {spaceMonster.Ferociousness}");
     Console.WriteLine($"{(spaceMonster.IsTough() ? "I am very tough" : "I am not very tough")}");
     Console.WriteLine($"You attacked {spaceMonster.Name} and they {spaceMonster.MonsterBattleResponse()}");
 }
Example #9
0
 private static void DisplayEditSpaceMonster(SpaceMonster mySpaceMonster)
 {
     DisplayHeader("edit sea monster");
     Console.WriteLine($"what name would like your space monster: {mySpaceMonster.name} to be?");
     mySpaceMonster.name = Console.ReadLine();
     Console.WriteLine($"your name is now changed to: {mySpaceMonster.name}");
     Console.WriteLine();
     Console.WriteLine($"what is your home galaxy?:{mySpaceMonster.Galaxy}");
     mySpaceMonster.Galaxy = Console.ReadLine();
     Console.WriteLine($"your home galaxy is the: {mySpaceMonster.Galaxy}");
     DisplayContinuePrompt();
 }
Example #10
0
        static void DisplayMonsterInfoScreen(SeaMonster seaMonster, SpaceMonster spaceMonster)
        {
            DisplayHeader("Monster Info");
            Console.WriteLine("Sea Monster");
            DisplaySeaMonsterInfo(seaMonster);

            Console.WriteLine();
            Console.WriteLine("Space Monster");
            DisplaySpaceMonsterInfo(spaceMonster);

            DisplayContinuePrompt();
        }
        static void DisplayMonsterInfoScreen(SeaMonster seaMonster, SpaceMonster spaceMonster, ForestMonster forestMonster)
        {
            DisplayHeader("Monster Information");

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

            DisplayContinuePrompt();
        }
Example #12
0
        private static void DisplayMonsterInfoScreen(SeaMonster seasMonster, SpaceMonster spaceMonster, DesertMonster myDesertMonster)
        {
            DisplayHeader("Monster Info");

            Console.WriteLine("Sea Monster");
            DisplaySeaMonsterInfo(seasMonster);

            Console.WriteLine();
            Console.WriteLine("Space Monster");
            DisplaySpaceMonster(spaceMonster);

            Console.ReadKey();
        }
 static void DispalySpaceMonster(SpaceMonster spaceMonster)
 {
     Console.WriteLine($"Id: {spaceMonster.ID}");
     Console.WriteLine($"Name: {spaceMonster.Name}");
     Console.WriteLine($"Owns a Spaceship: {(spaceMonster.HasSpaceShip ? "Yes" : "No" )}");
     Console.WriteLine($"Age: {spaceMonster.Age}");
     Console.WriteLine($"Active: {(spaceMonster.IsActive ? "Yes" : "No")}");
     Console.WriteLine($"Happiness Status:{spaceMonster.IsHappy()}");
     Console.WriteLine($"Home: {spaceMonster.HomeGalaxy} ");
     Console.WriteLine($"Fighting Style: {spaceMonster.FightingStyle}");
     Console.WriteLine($"{spaceMonster.Greeting()}");
     Console.WriteLine($"{spaceMonster.Background()}");
     Console.WriteLine($"Fights Won: {spaceMonster.FightsWon()}");
     Console.WriteLine($"High Value Target: {spaceMonster.isHVT}");
 }
Example #14
0
        private static void DisplaySpaceMonsterInfo(SpaceMonster spaceMonster)
        {
            Console.WriteLine($"Id: {spaceMonster.Id}");
            Console.WriteLine($"Name: {spaceMonster.Name}");
            Console.WriteLine($"Age: {spaceMonster.Age}");
            Console.WriteLine($"Height: {spaceMonster.Height}");
            Console.WriteLine($"Weight: {spaceMonster.Weight}");
            Console.WriteLine($"Owns a Spaceship: {(spaceMonster.OwnsSpaceship ? "Yes" : "NO")}");
            Console.WriteLine($"Needs Oxygen: {(spaceMonster.NeedOxygen ? "Yes" : "No")}");
            Console.WriteLine($"Galaxy: {spaceMonster.Galaxy}");
            Console.WriteLine($"Is Happy: {(spaceMonster.IsHappy() ? "Yes" : "No")}");
            Console.WriteLine(spaceMonster.Roar());
            Console.WriteLine(spaceMonster.Greeting());

            Console.WriteLine($"You attacked {spaceMonster.Name} and they {spaceMonster.MonsterBattleResponse()}");
        }
        static void DisplayMenu()
        {
            bool         exitMenu = false;
            SeaMonster   Nessy    = InitializeSeaMonster();
            SpaceMonster Jaal     = InitializeSpaceMonsters();


            do
            {
                DisplayHeader("Menu");
                Console.WriteLine("A) Display Monsters");
                Console.WriteLine("B) Fight Jaal");
                Console.WriteLine("C) Fight Nessy");
                Console.WriteLine("Q) Exit");
                Console.WriteLine("Enter Choice");
                string userChoice = Console.ReadLine().ToUpper();

                switch (userChoice)
                {
                case "A":
                    DisplayMonsterInfoScreen(Nessy, Jaal);
                    break;

                case "B":
                    DisplayFightingSpaceMonster(Jaal);
                    break;

                case "C":
                    DisplayFightingSeaMonster(Nessy);
                    break;

                case "Q":
                    DisplayClosingScreen();
                    exitMenu = true;
                    break;

                default:
                    Console.WriteLine("Please enter a valid choice");
                    DisplayContinuePrompt();
                    break;
                }
            } while (!exitMenu);
        }
Example #16
0
        private static void DisplaySpaceMonsterInfo(SpaceMonster spaceMonster)
        {
            Console.WriteLine($"Id: {spaceMonster.Id}");
            Console.WriteLine($"Name: {spaceMonster.Name}");
            Console.WriteLine($"Age: {spaceMonster.Age}");
            Console.WriteLine($"Language: {spaceMonster.Language}");
            Console.WriteLine($"Color: {spaceMonster.Color}");
            Console.WriteLine($"Weight: {spaceMonster.Weight}");
            Console.WriteLine($"Has a Tail: {spaceMonster.HasTail}");
            Console.WriteLine($"Can Fly: {spaceMonster.CanFly}");
            Console.WriteLine($"Galaxy: {spaceMonster.Galaxy}");
            Console.WriteLine($"Star System: {spaceMonster.System}");
            Console.WriteLine($"Home Planet: {spaceMonster.HomePlanet}");
            Console.WriteLine($"Number of Eyes: {spaceMonster.NumberOfEyes}");
            Console.WriteLine($"Is Happy: {(spaceMonster.IsHappy() ? "yes" : "no") }");
            Console.WriteLine($"Is Hostile: {(spaceMonster.IsHostile() ? "yes" : "no")}");

            Console.WriteLine($"You attacked {spaceMonster.Name} and they {spaceMonster.MonsterBattleResponse()}");
        }
        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);
        }
Example #18
0
        private static void DisplayEditMonster(SeaMonster mySeaMonster, SpaceMonster mySpaceMonster, DesertMonster myDesertMonster)
        {
            string menuSelection;
            bool   exitMenu = false;

            do
            {
                DisplayHeader("Edit your Monster");

                Console.WriteLine("Please Select A Monster to edit");
                Console.WriteLine($"A) {mySeaMonster.Name}");
                Console.WriteLine($"B) {mySpaceMonster.Name}");
                Console.WriteLine($"C) {myDesertMonster.Name}");
                Console.WriteLine("D) Return to Main Menu");
                menuSelection = Console.ReadLine().ToUpper();
                switch (menuSelection)
                {
                case "A":
                    EditSeaMonster(mySeaMonster);
                    break;

                case "B":
                    EditSpaceMonster(mySpaceMonster);
                    break;

                case "C":
                    EditDesertMonster(myDesertMonster);
                    break;

                case "D":
                    exitMenu = true;
                    break;

                default:
                    break;
                }
            } while (!exitMenu);
        }
Example #19
0
 public MonsterCommunications MonsterTradeInteractionResponse(SpaceMonster spaceMonster, SeaMonster seaMonster)
 {
     if (seaMonster.Gold <= WeaponSlotPrice3 && spaceMonster.Gold <= WeaponSlotPrice3 && seaMonster.Gold >= ArmourSlotPrice3 && spaceMonster.Gold >= ArmourSlotPrice3)
     {
         return(MonsterCommunications.THREATEN);
     }
     else if (seaMonster.Gold >= WeaponSlotPrice1 || spaceMonster.Gold >= WeaponSlotPrice1 || seaMonster.Gold >= ArmourSlotPrice1 || spaceMonster.Gold >= ArmourSlotPrice1)
     {
         return(MonsterCommunications.TRADE);
     }
     else if (seaMonster.Gold >= WeaponSlotPrice2 || seaMonster.Gold >= ArmourSlotPrice2 || spaceMonster.Gold >= ArmourSlotPrice2)
     {
         return(MonsterCommunications.HAPPY);
     }
     else if (seaMonster.Gold >= WeaponSlotPrice3 || spaceMonster.Gold >= WeaponSlotPrice3 || seaMonster.Gold >= ArmourSlotPrice3 || spaceMonster.Gold >= ArmourSlotPrice3)
     {
         return(MonsterCommunications.BEG);
     }
     else
     {
         return(MonsterCommunications.ANGRY);
     }
 }
Example #20
0
        private static void EditSpaceMonster(SpaceMonster mySpaceMonster)
        {
            DisplayHeader("Edit Your Space Monster");

            Console.WriteLine("What name would you like to change your space monster to?");
            mySpaceMonster.Name = Console.ReadLine();
            Console.WriteLine();

            Console.WriteLine("What is the new ID for this Monster?");
            mySpaceMonster.Id = int.Parse(Console.ReadLine());
            Console.WriteLine();

            Console.WriteLine("What is their new age?");
            mySpaceMonster.Age = int.Parse(Console.ReadLine());
            Console.WriteLine();

            Console.WriteLine("What is their new home galaxy?");
            mySpaceMonster.Galaxy = Console.ReadLine();
            Console.WriteLine();

            Console.WriteLine("Press any Key to return to the previous menu.");
            Console.ReadKey();
        }
Example #21
0
        static SpaceMonster DisplayAddNewSpaceMonster() // User creates a new SpaceMonster.
        {
            SpaceMonster userSpaceMonster = new SpaceMonster();
            int          userInt;
            bool         userBool;
            bool         isValid = true;

            DisplayHeader("Add New Space Monster");
            Console.WriteLine();

            do
            {
                isValid = true;

                CenterPadText(" New ID: ".PadLeft(30));
                if (!int.TryParse(Console.ReadLine(), out userInt))
                {
                    CenterText("That is not a valid entry. Please try again with an integer. \n");
                    isValid = false;
                }
                else
                {
                    userSpaceMonster.Id = userInt;
                }
            } while (!isValid); // Get ID

            CenterPadText("New Name: ");
            userSpaceMonster.Name = Console.ReadLine();

            do
            {
                isValid = true;

                CenterPadText(" New Age: ".PadLeft(30));
                if (!int.TryParse(Console.ReadLine(), out userInt))
                {
                    CenterText("That is not a valid entry. Please try again with an integer. \n");
                    isValid = false;
                }
                else
                {
                    userSpaceMonster.Age = userInt;
                }
            } while (!isValid); // Get Age

            do
            {
                isValid = true;

                CenterPadText(" New Height: ".PadLeft(30));
                if (!int.TryParse(Console.ReadLine(), out userInt))
                {
                    CenterText("That is not a valid entry. Please try again with an integer. \n");
                    isValid = false;
                }
                else
                {
                    userSpaceMonster.Height = userInt;
                }
            } while (!isValid); // Get Height

            do
            {
                isValid = true;

                CenterPadText(" New Weight: ".PadLeft(30));
                if (!int.TryParse(Console.ReadLine(), out userInt))
                {
                    CenterText("That is not a valid entry. Please try again with an integer. \n");
                    isValid = false;
                }
                else
                {
                    userSpaceMonster.Weight = userInt;
                }
            } while (!isValid); // Get ID

            CenterPadText("New Color: ");
            userSpaceMonster.Color = Console.ReadLine();

            do
            {
                isValid = true;

                CenterPadText(" New 'Eats Humans?': ".PadLeft(30));
                if (!bool.TryParse(Console.ReadLine(), out userBool))
                {
                    CenterText("That is not a valid entry. Please try again with 'true' or 'false'. \n");
                    isValid = false;
                }
                else
                {
                    userSpaceMonster.EatHumans = userBool;
                    isValid = true;
                }
            } while (!isValid); // Get Eats Humans

            do
            {
                isValid = true;

                CenterPadText(" New 'Plays Golf?': ".PadLeft(30));
                if (!bool.TryParse(Console.ReadLine(), out userBool))
                {
                    CenterText("That is not a valid entry. Please try again with 'true' or 'false'. \n");
                    isValid = false;
                }
                else
                {
                    userSpaceMonster.PlaysGolf = userBool;
                    isValid = true;
                }
            } while (!isValid); // Get Plays Golf

            CenterPadText("New Home Galaxy: ");
            userSpaceMonster.Galaxy = Console.ReadLine();

            return(userSpaceMonster);
        }
Example #22
0
        private static void DisplayEditSpaceMonster(SpaceMonster mySpaceMonster)
        {
            int    userResponseNum;
            double userResponseNum1;
            string userResponse;
            bool   loop = true;

            DisplayHeader("Edit Space Monster");
            Console.WriteLine();

            while (loop)
            {
                Console.Write("Id: ");

                if (int.TryParse(Console.ReadLine(), out userResponseNum))
                {
                    mySpaceMonster.Id = userResponseNum;
                    loop = false;
                }
                else
                {
                    Console.WriteLine("Please enter a valid whole number.");
                }
            }
            Console.Write("Name: ");
            mySpaceMonster.Name = Console.ReadLine();
            while (!loop)
            {
                Console.Write("Age: ");
                if (int.TryParse(Console.ReadLine(), out userResponseNum))
                {
                    mySpaceMonster.Age = userResponseNum;
                    loop = true;
                }
                else
                {
                    Console.WriteLine("Please enter a valid whole number.");
                }
            }
            while (loop)
            {
                Console.Write("Height: ");

                if (double.TryParse(Console.ReadLine(), out userResponseNum1))
                {
                    mySpaceMonster.Height = userResponseNum1;
                    loop = false;
                }
                else
                {
                    Console.WriteLine("Please enter a valid number.");
                }
            }
            while (!loop)
            {
                Console.Write("Weight: ");

                if (double.TryParse(Console.ReadLine(), out userResponseNum1))
                {
                    mySpaceMonster.Weight = userResponseNum1;
                    loop = true;
                }
                else
                {
                    Console.WriteLine("Please enter a valid number.");
                }
            }
            while (loop)
            {
                Console.Write("Owns a Spaceship: ");
                userResponse = Console.ReadLine().ToUpper();

                if (userResponse == "YES")
                {
                    mySpaceMonster.OwnsSpaceship = true;
                    loop = false;
                }
                else if (userResponse == "NO")
                {
                    mySpaceMonster.OwnsSpaceship = false;
                    loop = false;
                }
                else
                {
                    Console.WriteLine("Please enter Yes or No.");
                }
            }
            while (loop)
            {
                Console.Write("Needs Oxygen: ");
                userResponse = Console.ReadLine().ToUpper();

                if (userResponse == "YES")
                {
                    mySpaceMonster.NeedOxygen = true;
                    loop = false;
                }
                else if (userResponse == "NO")
                {
                    mySpaceMonster.NeedOxygen = false;
                    loop = false;
                }
                else
                {
                    Console.WriteLine("Please enter Yes or No.");
                }
            }
            Console.Write("Galaxy: ");
            mySpaceMonster.Galaxy = Console.ReadLine();
        }