Created and linked FillColor

This commit is contained in:
Lukasz Baldyga committed 2020-10-25 09:36:51 +00:00
1 parent f3316955b5
commit b1e307b6de
2 files changed
+32 -1

No files matched your search

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Advanced_Software_Engineering {
public class FillColor : Verb {
Drawer drawer;
Color color;
public FillColor(Drawer drawer, Color color) {
this.drawer = drawer;
this.color = color;
}
public void ExecuteVerb() {
drawer.SetFillColor(color);
}
public string GetDescription() {
return "Set fill color to " + color.ToString();
}
}
}
@@ -148,7 +148,9 @@ namespace Advanced_Software_Engineering {
return new PenColor(drawer, Value.TextToColor(parameters[0])); return new PenColor(drawer, Value.TextToColor(parameters[0]));
} else throw new Exception("Command has an incorrect number of parameters"); } else throw new Exception("Command has an incorrect number of parameters");
case "fill": case "fill":
if(parameters.Length == 1) {
return new FillColor(drawer, Value.TextToColor(parameters[0]));
} else throw new Exception("Command has an incorrect number of parameters");
default: default:
throw new Exception("Command not found"); throw new Exception("Command not found");