Private
Public Access
Changed DrawTo to IValue
This commit is contained in:
1 parent
894c495d70
commit
3708642e35
1 file changed
+6
-8
+6
-8
@@ -1,4 +1,5 @@
|
|||||||
using Advanced_Software_Engineering.Verbs.Value;
|
using Advanced_Software_Engineering.Verbs.Value;
|
||||||
|
using Advanced_Software_Engineering.Verbs.Value.ValueObjects;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
|
||||||
namespace Advanced_Software_Engineering.Verbs.DrawingVerbs {
|
namespace Advanced_Software_Engineering.Verbs.DrawingVerbs {
|
||||||
@@ -8,26 +9,23 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DrawTo : IVerb {
|
public class DrawTo : IVerb {
|
||||||
private readonly Drawer drawer;
|
private readonly Drawer drawer;
|
||||||
private readonly IValue moveToPointX;
|
private readonly PointValue moveToPoint;
|
||||||
private readonly IValue moveToPointY;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates the DrawTo intstance
|
/// Creates the DrawTo intstance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="drawer">drawer</param>
|
/// <param name="drawer">drawer</param>
|
||||||
/// <param name="x">X position to move to</param>
|
/// <param name="point">Position to move to</param>
|
||||||
/// <param name="y">Y position to move to</param>
|
public DrawTo(Drawer drawer, PointValue point) {
|
||||||
public DrawTo(Drawer drawer, IValue x, IValue y) {
|
|
||||||
this.drawer = drawer;
|
this.drawer = drawer;
|
||||||
moveToPointX = x;
|
moveToPoint = point;
|
||||||
moveToPointY = y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draws the line
|
/// Draws the line
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ExecuteVerb() {
|
public void ExecuteVerb() {
|
||||||
drawer.DrawLine(new Point(moveToPointX.ToInt(), moveToPointY.ToInt()));
|
drawer.DrawLine(moveToPoint.GetPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in new issue
Block a user