Added better constructor

This commit is contained in:
Lukasz Baldyga committed 2020-11-27 21:01:21 +00:00
1 parent 3ac8d5b28d
commit e49732b1c5
1 file changed
+10 -1
@@ -1,7 +1,7 @@
using Advanced_Software_Engineering.Verbs.Value.ValueTypes; using Advanced_Software_Engineering.Verbs.Value.ValueTypes;
using System.Drawing; using System.Drawing;
namespace Advanced_Software_Engineering.Verbs.Value.Value_Objects { namespace Advanced_Software_Engineering.Verbs.Value.ValueObjects {
public class PointValue { public class PointValue {
private IValue x; private IValue x;
@@ -17,12 +17,21 @@ namespace Advanced_Software_Engineering.Verbs.Value.Value_Objects {
this.y = y; this.y = y;
} }
public PointValue(string parameter1, string parameter2) {
x = ValueFactory.CreateValue(parameter1, "int");
y = ValueFactory.CreateValue(parameter2, "int");
}
public int GetX() { public int GetX() {
return x.ToInt(); return x.ToInt();
} }
public int GetY() { public int GetY() {
return y.ToInt(); return y.ToInt();
}
public Point GetPoint() {
return new Point(GetX(), GetY());
} }
} }
} }