Skip to content

Nothing serious, just a little OOP on the example of figures

License

Notifications You must be signed in to change notification settings

artgl42/MathOfShapes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MathOfShapes (dll)

Nothing serious, just playing OOP with shapes. Factory Method wrapped in Strategy O,O

Example

try
    {
        var shapes = Shape.ShapeBuilder
            .SetTriangle(RoundAccuracy.High, 2, 2.4, 3)
            .SetTriangle(RoundAccuracy.High, 1, 1.5)
            .SetRectangle(RoundAccuracy.High, 5, 4)
            .SetParallelogram(RoundAccuracy.High, 1, 1.5)
            .SetCircle(RoundAccuracy.High, 5.5)
            .Build();
        foreach (var shape in shapes)
            Console.WriteLine($"{shape.Area}");                
    }
    catch (Exception ex)
    {
        Console.WriteLine($"{ex.Message}");
    }
    Console.ReadKey();

About

Nothing serious, just a little OOP on the example of figures

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages