Private
Public Access
Created and linked FillColor
This commit is contained in:
1 parent
f3316955b5
commit
b1e307b6de
2 files changed
+32
-1
No files matched your search
+29
@@ -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]));
|
||||
} else throw new Exception("Command has an incorrect number of parameters");
|
||||
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:
|
||||
throw new Exception("Command not found");
|
||||
|
||||
Reference in new issue
Block a user