public override Polygon ParseInternal()
        {
            Polygon res = null;

            if (IsShapeNameCorrect())
            {
                if (TryParseFirstSideLength(out var firstSideLength) && TryParseSecondSideLength(out var secondSideLength) && TryParseAngle(out var angle))
                {
                    List <Point> points = ShapeGeometryCalculator.CalcPointsForScaleneTriangle(firstSideLength, secondSideLength, angle);
                    res = new Polygon(points);
                }
            }
            return(res);
        }
Exemplo n.º 2
0
        public override Polygon ParseInternal()
        {
            Polygon res = null;

            if (IsShapeNameCorrect())
            {
                if (TryParseWidth(out var width) && TryParseHeight(out var height))
                {
                    List <Point> points = ShapeGeometryCalculator.CalcPointsForIsoscelesTriangle(width, height);
                    res = new Polygon(points);
                }
            }
            return(res);
        }
        public override Polygon ParseInternal()
        {
            Polygon res = null;

            if (IsShapeNameCorrect())
            {
                if (TryParseSideLength(out var sideLength))
                {
                    List <Point> points = ShapeGeometryCalculator.CalcPointsForEquilateralTriangle(sideLength);
                    res = new Polygon(points);
                }
            }
            return(res);
        }
Exemplo n.º 4
0
        public override Polygon ParseInternal()
        {
            Polygon res = null;

            if (IsShapeNameCorrect())
            {
                if (true)
                {
                    if (TryParseSideLength(out var sideLength))
                    {
                        List <Point> points = ShapeGeometryCalculator.CalcPointsForRegularPoligon(SidesCount, sideLength);
                        res = new Polygon(points);
                    }
                }
            }

            return(res);
        }
        public override Polygon ParseInternal()
        {
            Polygon res = null;

            if (IsShapeNameCorrect())
            {
                if (true)
                {
                    if (TryParseWidth(out var width) && TryParseHeight(out var height) && TryParseAngle(out var angle))
                    {
                        List <Point> points = ShapeGeometryCalculator.CalcPointsForParallelogram(width, height, angle);
                        res = new Polygon(points);
                    }
                }
            }

            return(res);
        }