From 894c495d70879936d66d9e5593f1d8542b5f50f7 Mon Sep 17 00:00:00 2001 From: Lukasz Baldyga Date: Fri, 27 Nov 2020 21:04:53 +0000 Subject: [PATCH] Converted MoveTo to IValue --- .../Verbs/DrawingVerbs/MoveTo.cs | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/Advanced Software Engineering/Advanced Software Engineering/Verbs/DrawingVerbs/MoveTo.cs b/Advanced Software Engineering/Advanced Software Engineering/Verbs/DrawingVerbs/MoveTo.cs index 82cdf07..aa1aa31 100644 --- a/Advanced Software Engineering/Advanced Software Engineering/Verbs/DrawingVerbs/MoveTo.cs +++ b/Advanced Software Engineering/Advanced Software Engineering/Verbs/DrawingVerbs/MoveTo.cs @@ -1,4 +1,5 @@ -using System.Drawing; +using Advanced_Software_Engineering.Verbs.Value; +using Advanced_Software_Engineering.Verbs.Value.ValueObjects; namespace Advanced_Software_Engineering.Verbs.DrawingVerbs { @@ -7,7 +8,7 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs { /// public class MoveTo : IVerb { private readonly Drawer drawer; - private readonly Point moveToPoint; + private readonly PointValue moveToPoint; /// /// Creates a MoveTo instance @@ -15,26 +16,16 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs { /// drawer /// X position /// Y position - public MoveTo(Drawer drawer, int x, int y) { + public MoveTo(Drawer drawer, PointValue point) { this.drawer = drawer; - this.moveToPoint = new Point(x, y); - } - - /// - /// Creates a MoveTo instance - /// - /// drawer - /// Point of the position - public MoveTo(Drawer drawer, Point point) { - this.drawer = drawer; - this.moveToPoint = point; + moveToPoint = point; } /// /// Moves the pen to the position /// public void ExecuteVerb() { - this.drawer.MovePen(moveToPoint); + drawer.MovePen(moveToPoint.GetPoint()); } /// @@ -42,7 +33,7 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs { /// /// Description where the pen will move to public string GetDescription() { - return "Move origin to " + moveToPoint.X + ", " + moveToPoint.Y; + return "Move origin"; } } } \ No newline at end of file