Example #1
0
        /// <summary>
        /// ExecuteSelection
        ///
        /// Executes the needed methods for the option
        ///
        /// </summary>
        /// <param name="selection">The option name</param>
        /// <param name="map">The subway map</param>
        public void ExecuteSelection(string selection, SubwayMap <char> map)
        {
            switch (selection)
            {
            case "Add Station":
                AddStation();
                Helper.Wait();
                break;

            case "Add Link":
                AddLink();
                Helper.Wait();
                break;

            case "Remove Link":
                RemoveLink();
                Helper.Wait();
                break;

            case "Find shortest path between two stations":
                ShortestPath();
                Helper.Wait();
                break;

            case "Print the Graph":
                Console.Clear();
                map.PrintGraph();
                Helper.Wait();
                break;

            case "Find the articulation points":
                map.CriticalPoints();
                Helper.Wait();
                break;

            case "Test1":
                Test1(map);
                Helper.Wait();
                break;

            case "Test2":
                Test2(map);
                Helper.Wait();
                break;

            case "Test3":
                Test3(map);
                Helper.Wait();
                break;

            case "Clear Graph":
                this.map = new SubwayMap <char>();
                Console.WriteLine("Graph is cleared");
                Helper.Wait();
                break;

            case "Exit":
                Environment.Exit(1);
                break;

            default:
                Environment.Exit(1);
                break;
            }
        }