Ejemplo n.º 1
0
        private void LoadFigureMenu()
        {
            Console.WriteLine("Load figure menu:\n" +
                              "Load a polygon - 1\n" +
                              "Load a polyhedron - 2\n" +
                              "Back to the main menu - b");

            Console.Write("Input: ");
            string input = Console.ReadLine();

            Console.WriteLine();

            string name;
            Figure figure;

            switch (input.ToLower())
            {
            case "1":
                Console.Write("Enter the figure name : ");
                name = Console.ReadLine();
                Console.WriteLine();

                figure = _interactor.LoadPolygon(name);

                if (figure is Polygon)
                {
                    Console.Clear();
                    _interactor.SetFigure(figure);
                    PolygonParamsMenu();
                }

                break;

            case "2":
                Console.Write("Enter the figure name : ");
                name = Console.ReadLine();
                Console.WriteLine();

                figure = _interactor.LoadPolyhedron(name);
                if (figure is Polyhedron)
                {
                    Console.Clear();
                    _interactor.SetFigure(figure);
                    PolyhedronParamsMenu();
                }

                break;

            case "b":
                Console.Clear();

                return;

            default:
                Console.Clear();
                LoadFigureMenu();

                break;
            }

            LoadFigureMenu();
        }