Esempio n. 1
0
        public Polygon CreatePolygon(string type, List <Coords> coords)
        {
            try
            {
                Polygon polygon = PolygonFactory.FactoryMethod(type, coords);
                return(polygon);
            }
            catch (Exception e)
            {
                Console.Clear();

                ConsoleView.ColorizeError(e.Message);

                Console.WriteLine();
                return(null);
            }
        }
Esempio n. 2
0
        public Polyhedron LoadPolyhedron(string name)
        {
            try
            {
                FigureData figureData = _database.LoadPolyhedron(name);

                Polygon polygon = PolygonFactory.FactoryMethod(figureData.PolygonType, figureData.Coords);
                return(CreatePolyhedron(figureData.PolyhedronType, polygon, figureData.Height));
            }
            catch (Exception e)
            {
                Console.Clear();

                ConsoleView.ColorizeError(e.Message);

                Console.WriteLine();

                return(null);
            }
        }