diff --git a/implemented_readme.adoc b/implemented_readme.adoc new file mode 100644 index 0000000..dbdacbd --- /dev/null +++ b/implemented_readme.adoc @@ -0,0 +1,89 @@ += Things about the completed assignment: + +== Class Diagram: +[plantuml] +---- +@startuml + +abstract class Shape { + # static int _nextId + # const double DefaultLineThickness + + int Id { get } + # Point Position + # Point Scale + # double? LineThickness + # IBrush? LineColor + # IBrush? FillColor + # Shape(Point, Point, double?, IBrush?, IBrush?) + + {abstract} bool DrawSelf(Point, Point, double?, IBrush?, IBrush? ) + + {abstract} bool PointInShape(Point mousePoint) +} + +class Square { + - const int SideLengthMin + - const int SideLengthMax + + Square(Point, Point, double?, IBrush?, IBrush?) + + override bool DrawSelf(Point, Point scale, double?, IBrush?, IBrush?) + + override bool PointInShape(Point) +} + +class Rectangle { + - const int SideLengthMin + - const int SideLengthMax + + Rectangle(Point, Point, double?, IBrush?, IBrush?) + + override bool DrawSelf(Point, Point, double?, IBrush?, IBrush?) + + override bool PointInShape(Point) +} + +class Circle { + - const int RadiusMin + - const int RadiusMax + + Circle(Point, Point, double?, IBrush?, IBrush?) + + override bool DrawSelf(Point, Point, double?, IBrush?, IBrush?) + + override bool PointInShape(Point) +} + +class Triangle { + - const int SideLengthMin + - const int SideLengthMax + + Triangle(Point, Point, double?, IBrush?, IBrush?) + + override bool DrawSelf(Point, Point, double?, IBrush?, IBrush?) + + override bool PointInShape(Point) + - static Point[] CalculateTriangleVertices(Point, double) + - static bool IsPointInTriangle(Point, Point, Point, Point) +} + +class ShapeGenerator { + - double _maxX + - double _maxY + - int _nextShape + - Random _random + - const int MinShapeIdx + - const int MaxShapeIdx + - static readonly IBrush[] colors + + ShapeGenerator(double, double) + + Shape CreateNewShape(Point) +} + +class Program { + - List shapes + - ShapeGenerator generator + + void Run() + + void HandleClick(ClickEvent) + + void Redraw() +} + +Shape <|-- Square +Shape <|-- Rectangle +Shape <|-- Circle +Shape <|-- Triangle +ShapeGenerator ..> Shape : creates > +Program o-- ShapeGenerator +Program o-- "*" Shape : contains > + +@enduml +---- + +== Side notes: + +- Feature: When it attempts to create a new shape out of the bounds of the canvas, it fails and notifies the user \ No newline at end of file