Updated Expression Value to not use drawer parameter

This commit is contained in:
Lukasz Baldyga committed 2020-11-29 12:01:44 +00:00
1 parent a0fa3f38ff
commit c74ee42b38
2 files changed
+4 -4

No files matched your search

@@ -22,8 +22,8 @@ namespace Advanced_Software_Engineering.Verbs.DrawingVerbs {
/// <param name="width">rectangle width</param> /// <param name="width">rectangle width</param>
/// <param name="height">rectangle height</param> /// <param name="height">rectangle height</param>
public Rectangle(Drawer drawer, IValue width, IValue height) { public Rectangle(Drawer drawer, IValue width, IValue height) {
IValue negativeWidth = new ExpressionValue(drawer, new IntValue(0), width, ExpressionValue.SUBTRACT); IValue negativeWidth = new ExpressionValue(new IntValue(0), width, ExpressionValue.SUBTRACT);
IValue negativeHeight = new ExpressionValue(drawer, new IntValue(0), height, ExpressionValue.SUBTRACT); IValue negativeHeight = new ExpressionValue(new IntValue(0), height, ExpressionValue.SUBTRACT);
points = new PointValue[] points = new PointValue[]
{ {
@@ -16,7 +16,7 @@ namespace Advanced_Software_Engineering.Verbs.Value {
private bool evaluated = false; private bool evaluated = false;
private IValue evaluatedValue; private IValue evaluatedValue;
public ExpressionValue(Drawer drawer, IValue variable1, IValue variable2, int operation) { public ExpressionValue(IValue variable1, IValue variable2, int operation) {
this.variable1 = variable1; this.variable1 = variable1;
this.variable2 = variable2; this.variable2 = variable2;
this.operation = operation; this.operation = operation;
@@ -25,7 +25,7 @@ namespace Advanced_Software_Engineering.Verbs.Value {
if (operation > 3 && operation < 0) throw new Exception("Bad operation"); if (operation > 3 && operation < 0) throw new Exception("Bad operation");
} }
public ExpressionValue(Drawer drawer, IValue variable1, IValue variable2, string operation) { public ExpressionValue(IValue variable1, IValue variable2, string operation) {
switch (operation) { switch (operation) {
case "+": case "+":
this.operation = ADD; this.operation = ADD;