Private
Public Access
Documented DrawTo
This commit is contained in:
1 parent
353853cf0e
commit
fed5315308
1 file changed
+19
-2
+19
-2
@@ -6,19 +6,36 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Advanced_Software_Engineering.Verbs.DrawingVerbs {
|
||||
/// <summary>
|
||||
/// DrawTo Verb class
|
||||
/// </summary>
|
||||
public class DrawTo : Verb {
|
||||
protected Drawer drawer;
|
||||
protected Point moveToPoint;
|
||||
|
||||
Drawer drawer;
|
||||
Point 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, int x, int y) {
|
||||
this.drawer = drawer;
|
||||
moveToPoint = new Point(x, y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the line
|
||||
/// </summary>
|
||||
public void ExecuteVerb() {
|
||||
drawer.DrawLine(moveToPoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes how the line is going to be drawn
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetDescription() {
|
||||
return "Draw line " + moveToPoint.X + ", " + moveToPoint.Y;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user