/// <summary>
        /// instantiate and initialize sid the sea monster
        /// </summary>
        /// <param name="name">name</param>
        /// <returns>SeaMonster object</returns>
        static SeaMonster InitializeSeaMonsterSid(string name)
        {
            SeaMonster sid = new SeaMonster("Sid");

            sid.Weight                = 2.5;
            sid.CanUseFreshWater      = true;
            sid.CurrentEmotionalState = SeaMonster.EmotionalState.Angry;
            sid.HomeSea               = "Red Sea";
            sid.NumberOfTeeth         = 77;
            return(sid);
        }
        /// <summary>
        /// instantiate and initialize suzy the sea monster
        /// </summary>
        /// <returns>SeaMonster object</returns>
        static SeaMonster InitializeSeaMonsterSuzy()
        {
            SeaMonster suzy = new SeaMonster();

            suzy.Name                  = "Suzy";
            suzy.Weight                = 1.2;
            suzy.CanUseFreshWater      = true;
            suzy.CurrentEmotionalState = SeaMonster.EmotionalState.Sad;
            suzy.HomeSea               = "Loch Ness";
            suzy.NumberOfTeeth         = 44;
            return(suzy);
        }
        /// <summary>
        /// display a screen to get a new sea monster from the user
        /// </summary>
        /// <param name="seaMonsters">list of SeaMonster</param>
        static void DisplayGetUserSeaMonster(List <SeaMonster> seaMonsters)
        {
            SeaMonster newSeaMonster = new SeaMonster();
            string     uv;

            DisplayHeader("Add a Sea Monster");

            Console.WriteLine("Enter Name");
            Console.WriteLine();
            newSeaMonster.Name = Console.ReadLine();
            Console.Clear();
            Console.WriteLine("Enter Weight");
            Console.WriteLine();
            Double.TryParse(Console.ReadLine(), out double weight);
            newSeaMonster.Weight = weight;
            Console.Clear();
            Console.WriteLine("Can this Monster Live in Fresh Water? Enter Yes or No:");
            Console.WriteLine();
            uv = Console.ReadLine();
            if (uv.ToUpper() == "YES")
            {
                newSeaMonster.CanUseFreshWater = true;
            }
            else
            {
                newSeaMonster.CanUseFreshWater = false;
            }
            Console.Clear();
            Console.WriteLine("Enter Emotional State, Happy, Sad, or Angry:");
            Console.WriteLine();
            Enum.TryParse(Console.ReadLine(), out SeaMonster.EmotionalState emotionalstate);
            newSeaMonster.CurrentEmotionalState = emotionalstate;
            Console.Clear();
            Console.WriteLine("Enter Sea Monster Home Sea:");
            Console.WriteLine();
            newSeaMonster.HomeSea = Console.ReadLine();
            Console.Clear();
            Console.WriteLine("Enter Number of Teeth");
            Console.WriteLine();
            double.TryParse(Console.ReadLine(), out double NumberOfTeeth);
            newSeaMonster.NumberOfTeeth = NumberOfTeeth;

            //
            // Add a New Sea Monster to the List
            //
            seaMonsters.Add(newSeaMonster);

            DisplayContinuePrompt();
        }
        static void DisplayGetUpdatedSeaMonster(List <SeaMonster> seaMonsters)
        {
            string seaMonsterName;

            DisplayHeader("Update Sea Monster Info");

            //
            // Display List of Sea Monster Names
            //
            foreach (SeaMonster seaMonster in seaMonsters)
            {
                Console.Write(seaMonster.Name);
            }
            Console.WriteLine();
            Console.Write("Enter Name of Sea Monster to Update");
            seaMonsterName = Console.ReadLine();
            bool monsterFound = false;

            foreach (SeaMonster seaMonster in seaMonsters)
            {
                if (seaMonster.Name == seaMonsterName)
                {
                    seaMonsters.Remove(seaMonster);

                    monsterFound = true;
                    break;
                }
            }
            if (!monsterFound)
            {
                Console.WriteLine("Monster unable to be found.");
            }
            DisplayContinuePrompt();

            SeaMonster updatedSeaMonster = new SeaMonster();
            string     uv;

            DisplayHeader("Update a Sea Monster");

            Console.WriteLine("Enter Name");
            Console.WriteLine();
            updatedSeaMonster.Name = Console.ReadLine();
            Console.Clear();
            Console.WriteLine("Enter Weight");
            Console.WriteLine();
            Double.TryParse(Console.ReadLine(), out double weight);
            updatedSeaMonster.Weight = weight;
            Console.Clear();
            Console.WriteLine($"Can " + updatedSeaMonster.Name + " Live in Fresh Water? Enter Yes or No:");
            Console.WriteLine();
            uv = Console.ReadLine();

            if (uv.ToUpper() == "YES")
            {
                updatedSeaMonster.CanUseFreshWater = true;
            }
            else
            {
                updatedSeaMonster.CanUseFreshWater = false;
            }
            Console.Clear();
            Console.WriteLine("Enter Emotional State, Happy, Sad, or Angry:");
            Console.WriteLine();
            Enum.TryParse(Console.ReadLine(), out SeaMonster.EmotionalState emotionalstate);
            updatedSeaMonster.CurrentEmotionalState = emotionalstate;
            Console.Clear();
            Console.WriteLine("Enter Sea Monster Home Sea:");
            Console.WriteLine();
            updatedSeaMonster.HomeSea = Console.ReadLine();
            Console.Clear();
            Console.WriteLine("Enter Number of Teeth");
            Console.WriteLine();
            double.TryParse(Console.ReadLine(), out double NumberOfTeeth);
            updatedSeaMonster.NumberOfTeeth = NumberOfTeeth;

            //
            // Add Updated Sea Monster to the List
            //
            seaMonsters.Add(updatedSeaMonster);

            DisplayContinuePrompt();
        }
Example #5
0
 /// <summary>
 /// display all information about a sea monster
 /// </summary>
 /// <param name="seaMonster">SeaMonster object</param>
 static void DisplaySeaMonsterInfo(SeaMonster seaMonster)
 {
 }