예제 #1
0
        public EquilateralTriangle(decimal width, decimal height, _CalcTypes calc)
        {
            switch (calc)
            {
            case _CalcTypes.AreaCalc:
                Area = Math.Round(CalculateArea(width, height), 3, MidpointRounding.AwayFromZero);
                break;

            case _CalcTypes.PerimeterCalc:
                Perimeter = Math.Round(CalculatePerimeter(width), 3, MidpointRounding.AwayFromZero);
                break;

            default:
                break;
            }
        }
예제 #2
0
        public Square(decimal length, _CalcTypes calc)
        {
            switch (calc)
            {
            case _CalcTypes.AreaCalc:
                Area = CalculateArea(length);
                break;

            case _CalcTypes.PerimeterCalc:
                Perimeter = CalculatePerimeter(length);
                break;

            default:
                break;
            }
        }
예제 #3
0
        public Ellipse(decimal longRadius, decimal shortRadius, _CalcTypes calc)
        {
            switch (calc)
            {
            case _CalcTypes.AreaCalc:
                Area = Math.Round(CalculateArea(longRadius, shortRadius), 3, MidpointRounding.AwayFromZero);
                break;

            case _CalcTypes.PerimeterCalc:
                Perimeter = Math.Round(CalculatePerimeter(longRadius, shortRadius), 3, MidpointRounding.AwayFromZero);
                break;

            default:
                //Perhaps log an issue here?
                break;
            }
        }
예제 #4
0
        public Rectangle(decimal width, decimal height, _CalcTypes calc)
        {
            switch (calc)
            {
            case _CalcTypes.AreaCalc:
                Area = CalculateArea(width, height);
                break;

            case _CalcTypes.PerimeterCalc:
                Perimeter = CalculatePerimeter(width, height);
                break;

            default:
                //Maybe add an issue logger?
                break;
            }
        }
예제 #5
0
        public Cuboid(decimal height, decimal width, decimal length, _CalcTypes calc)
        {
            switch (calc)
            {
            case _CalcTypes.AreaCalc:
                SurfaceArea = CalculateArea(height, width, length);
                break;

            case _CalcTypes.VolumeCalc:
                Volume = CalculateVolume(height, width, length);
                break;

            default:
                //Perhaps log an issue here?
                break;
            }
        }
예제 #6
0
        public Sphere(decimal radius, _CalcTypes calc)
        {
            switch (calc)
            {
            case _CalcTypes.AreaCalc:
                SurfaceArea = Math.Round(CalculateArea(radius), 3, MidpointRounding.AwayFromZero);
                break;

            case _CalcTypes.VolumeCalc:
                Volume = Math.Round(CalculateVolume(radius), 3, MidpointRounding.AwayFromZero);
                break;

            default:
                //Perhaps log an issue here?
                break;
            }
        }
예제 #7
0
        public Prism(decimal height, decimal width, decimal length, _CalcTypes calc, _3DBases shapeBase)
        {
            switch (calc)
            {
            case _CalcTypes.AreaCalc:
                SurfaceArea = Math.Round(CalculateArea(height, width, length, shapeBase), 3, MidpointRounding.AwayFromZero);
                break;

            case _CalcTypes.VolumeCalc:
                Volume = Math.Round(CalculateVolume(height, width, length, shapeBase), 3, MidpointRounding.AwayFromZero);
                break;

            default:
                //Perhaps log an issue here?
                break;
            }
        }
예제 #8
0
 public ActionResult <Cylinder> Cylinder(decimal radius, decimal length, _CalcTypes calc)
 {
     //calc is used for an Enum to tell the Circle constructor what method to use
     return(new Cylinder(radius, length, calc));
 }
예제 #9
0
 public ActionResult <Cuboid> Cuboid(decimal height, decimal length, decimal width, _CalcTypes calc)
 {
     //calc is used for an Enum to tell the constructor what method to use
     return(new Cuboid(height, width, length, calc));
 }
예제 #10
0
 public ActionResult <Cube> Cube(decimal length, _CalcTypes calc)
 {
     //calc is used for an Enum to tell the constructor what method to use
     return(new Cube(length, calc));
 }
예제 #11
0
 public ActionResult <Cone> Cone(decimal radius, decimal height, _CalcTypes calc)
 {
     //calc is used for an Enum to tell the constructor what method to use
     return(new Cone(radius, height, calc));
 }
예제 #12
0
 public ActionResult <Right_AngledTriangle> Right_AngledTriangle(decimal width, decimal height, _CalcTypes calc)
 {
     //calc is used for an Enum to tell the constructor what method to use
     return(new Right_AngledTriangle(width, height, calc));
 }
예제 #13
0
 public ActionResult <Rectangle> Rectangle(decimal length, decimal width, _CalcTypes calc)
 {
     //calc is used for an Enum to tell the constructor what method to use
     return(new Rectangle(length, width, calc));
 }
예제 #14
0
 public ActionResult <Ellipse> Ellipse(decimal longRadius, decimal shortRadius, _CalcTypes calc)
 {
     //calc is used for an Enum to tell the constructor what method to use
     return(new Ellipse(longRadius, shortRadius, calc));
 }
예제 #15
0
 public ActionResult <Circle> Circle(decimal radius, _CalcTypes calc)
 {
     //calc is used for an Enum to tell the constructor what method to use
     return(new Circle(radius, calc));
 }
예제 #16
0
 public ActionResult <Pyramid> Pyramid(decimal height, decimal width, decimal length, _CalcTypes calc, _3DBases b)
 {
     //calc is used for an Enum to tell the Circle constructor what method to use
     //b is used to tell whether the shape has a triangular or square base
     return(new Pyramid(height, width, length, calc, b));
 }