Esempio n. 1
0
        private void PolyhedronParamsMenu()
        {
            Console.WriteLine("Polyhedron parameters menu:\n" +
                              "Base area - 1\n" +
                              "Volume - 2\n" +
                              "Apexes amount - 3\n" +
                              "Edges amount - 4\n" +
                              "Brinks amount - 5\n" +
                              "Save polyhedron - 6\n" +
                              "Back - b");

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

            Console.WriteLine();

            try
            {
                switch (input)
                {
                case "1":
                    Console.Clear();
                    ConsoleView.ColorizeSuccess($"Base area : {_interactor.GetBaseArea()}");
                    Console.WriteLine();

                    break;

                case "2":
                    Console.Clear();
                    ConsoleView.ColorizeSuccess($"Volume : {_interactor.GetVolume()}");
                    Console.WriteLine();

                    break;

                case "3":
                    Console.Clear();
                    ConsoleView.ColorizeSuccess($"Apexes : {_interactor.GetApexes()}");
                    Console.WriteLine();

                    break;

                case "4":
                    Console.Clear();
                    ConsoleView.ColorizeSuccess($"Edges : {_interactor.GetEdges()}");
                    Console.WriteLine();

                    break;

                case "5":
                    Console.Clear();
                    ConsoleView.ColorizeSuccess($"Brinks : {_interactor.GetBrinks()}");
                    Console.WriteLine();
                    break;

                case "6":
                    Console.WriteLine("Enter the figure name : ");
                    string name = Console.ReadLine();
                    Console.Clear();

                    if (_interactor.SavePolyhedron(name))
                    {
                        ConsoleView.ColorizeInfo("Polyhedron was successfully saved");
                        Console.WriteLine();
                    }

                    break;

                case "b":
                    Console.Clear();
                    return;
                }
            }
            catch (Exception e)
            {
                Console.Clear();
                ConsoleView.ColorizeError(e.Message);
                Console.WriteLine();
            }

            PolyhedronParamsMenu();
        }