Example #1
0
        /// <summary>
        /// RemoveLink
        ///
        /// Runs the method for removing links
        /// </summary>
        public void RemoveLink()
        {
            bool error = true;

            //Get the first station
            Console.Write("First Station: ");
            if (char.TryParse(Console.ReadLine(), out char fromStation))
            {
                //Get the second station
                Console.Write("Enter the second station: ");
                if (char.TryParse(Console.ReadLine(), out char toStation))
                {
                    //Get the color of the link
                    Console.Write("Enter the color of the link: ");
                    if (Enum.TryParse(Console.ReadLine(), true, out ConsoleColor linkColor))
                    {
                        error = false;
                        map.RemoveLink(fromStation, toStation, linkColor);
                    }
                }
            }

            //Check if there was an error to print the message
            if (error)
            {
                Helper.MessageDisplay("Invalid Input", ConsoleColor.Red);
            }
        }