Added custom readme with class diagram

This commit is contained in:
MarcUs7i 2025-03-16 23:42:28 +01:00
parent be719d379c
commit a728cf3131

89
implemented_readme.adoc Normal file
View file

@ -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<Shape> 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