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.ValueObjects;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Advanced_Software_Engineering.Verbs.DrawingVerbs {
|
||||
@@ -8,26 +9,23 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs {
|
||||
/// </summary>
|
||||
public class DrawTo : IVerb {
|
||||
private readonly Drawer drawer;
|
||||
private readonly IValue moveToPointX;
|
||||
private readonly IValue moveToPointY;
|
||||
private readonly PointValue moveToPoint;
|
||||
|
||||
/// <summary>
|
||||
/// Creates the DrawTo intstance
|
||||
/// </summary>
|
||||
/// <param name="drawer">drawer</param>
|
||||
/// <param name="x">X position to move to</param>
|
||||
/// <param name="y">Y position to move to</param>
|
||||
public DrawTo(Drawer drawer, IValue x, IValue y) {
|
||||
/// <param name="point">Position to move to</param>
|
||||
public DrawTo(Drawer drawer, PointValue point) {
|
||||
this.drawer = drawer;
|
||||
moveToPointX = x;
|
||||
moveToPointY = y;
|
||||
moveToPoint = point;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the line
|
||||
/// </summary>
|
||||
public void ExecuteVerb() {
|
||||
drawer.DrawLine(new Point(moveToPointX.ToInt(), moveToPointY.ToInt()));
|
||||
drawer.DrawLine(moveToPoint.GetPoint());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user