From ff8bda2f664b703e0cff47a7821a0a0bd80ef967 Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Tue, 3 Nov 2020 12:57:39 +0000 Subject: [PATCH] Documented RegularPolygon --- .../Verbs/DrawingVerbs/RegularPolygon.cs | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Advanced Software Engineering/Advanced Software Engineering/Verbs/DrawingVerbs/RegularPolygon.cs b/Advanced Software Engineering/Advanced Software Engineering/Verbs/DrawingVerbs/RegularPolygon.cs index 5f05761..fb23e3d 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Verbs/DrawingVerbs/RegularPolygon.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Verbs/DrawingVerbs/RegularPolygon.cs @@ -10,13 +10,22 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs { /// A class that generates a RegularPolygon verb. /// public class RegularPolygon : Verb { - protected Drawer drawer; - protected int sides; - protected double scale; - protected double offset; + Drawer drawer; + int sides; + double scale; + double offset; List points; - + /// + /// Draws a regular polygon. + /// See . + /// See also . + /// + /// drawer + /// Number of sides in the regular polygon + /// The scale of the regular polygon + /// Rotation offset of the regular polygon + /// Default is true. If true, offset is in degrees. If false, offset is in gradians. public RegularPolygon(Drawer drawer, int sides, double scale, double offset = 0, bool degMode = true) { points = new List(); @@ -39,6 +48,9 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs { this.offset = offset; } + /// + /// Draws the regular polygons + /// public void ExecuteVerb() { Point currentOrigin = drawer.GetPenPosition(); List originShiftedPoints = new List(); @@ -46,6 +58,10 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs { drawer.DrawLines(originShiftedPoints.ToArray()); } + /// + /// Describes how the regular polygon will be drawn + /// + /// A description of how the polygon will be drawn public string GetDescription() { return "Draws a " + sides + " sided regular polygon, with rotation of " + offset + " radians, with inner radius of " + scale; }