Added parameter limits

This commit is contained in:
Lukasz Baldyga committed 2020-10-25 08:26:01 +00:00
1 parent 750fc30c1a
commit 5dc7ec0d52
2 files changed
+13

No files matched your search

@@ -67,12 +67,15 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Verbs\DrawingVerbs\Circle.cs" />
<Compile Include="Verbs\DrawingVerbs\Clear.cs" />
<Compile Include="Verbs\DrawingVerbs\Dot.cs" />
<Compile Include="Verbs\DrawingVerbs\DrawLines.cs" />
<Compile Include="Verbs\DrawingVerbs\DrawTo.cs" />
<Compile Include="Verbs\DrawingVerbs\MoveTo.cs" />
<Compile Include="Verbs\DrawingVerbs\Quadrilateral.cs" />
<Compile Include="Verbs\DrawingVerbs\Rectangle.cs" />
<Compile Include="Verbs\DrawingVerbs\RegularPolygon.cs" />
<Compile Include="Verbs\DrawingVerbs\ResetPen.cs" />
<Compile Include="Verbs\DrawingVerbs\Square.cs" />
<Compile Include="Verbs\DrawingVerbs\Triangle.cs" />
<Compile Include="Verbs\Value.cs" />
@@ -128,10 +128,20 @@ namespace Advanced_Software_Engineering {
} else throw new Exception("Command has an incorrect number of parameters");
case "dot":
if (parameters.Length == 0) {
return new Dot(drawer);
} else throw new Exception("Command doesn't take parameters");
case "clear":
if (parameters.Length == 0) {
return new Clear(drawer);
} else throw new Exception("Command doesn't take parameters");
case "reset":
if (parameters.Length == 0) {
return new ResetPen(drawer);
} else throw new Exception("Command doesn't take parameters");
case "pen":
case "fill":