Esempio n. 1
0
        public Triangle(string Name, double SideA, double SideB, double SideC)
            : base(Name, new double[] { SideA, SideB, SideC }, ShapeType.Triangle)
        {
            var distinctLenths = Sides.Distinct().Count();

            switch (distinctLenths)
            {
            case 1:
                this.SubType = TriangleType.Isosceles.ToString();
                break;

            case 2:
                this.SubType = TriangleType.Equalateral.ToString();
                break;

            case 3:
                this.SubType = TriangleType.Scalene.ToString();
                break;

            default:
                this.SubType = TriangleType.Unknown.ToString();
                break;
            }
        }