Private
Public Access
Added more methods to CreateValue
This commit is contained in:
1 parent
9414f818fd
commit
5024793c3e
1 file changed
+30
+30
@@ -1,4 +1,5 @@
|
|||||||
using Advanced_Software_Engineering.Verbs.Value.ValueTypes;
|
using Advanced_Software_Engineering.Verbs.Value.ValueTypes;
|
||||||
|
using Advanced_Software_Engineering.Verbs.Value.ValueObjects;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Advanced_Software_Engineering.Verbs.Value {
|
namespace Advanced_Software_Engineering.Verbs.Value {
|
||||||
@@ -30,6 +31,35 @@ namespace Advanced_Software_Engineering.Verbs.Value {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IValue CreateValue(Drawer drawer, string paramater1, string paramater2, string parameter3, string parameter4, string type) {
|
||||||
|
switch (type) {
|
||||||
|
case "color":
|
||||||
|
IValue p1 = CreateValue(drawer, paramater1);
|
||||||
|
IValue p2 = CreateValue(drawer, paramater2);
|
||||||
|
IValue p3 = CreateValue(drawer, parameter3);
|
||||||
|
IValue p4 = CreateValue(drawer, parameter4);
|
||||||
|
|
||||||
|
return new ColorValue(p1, p2, p3, p4);
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new Exception("Unknown expected type: " + type.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IValue CreateValue(Drawer drawer, string paramater1, string paramater2, string parameter3, string type) {
|
||||||
|
switch (type) {
|
||||||
|
case "color":
|
||||||
|
IValue p1 = CreateValue(drawer, paramater1);
|
||||||
|
IValue p2 = CreateValue(drawer, paramater2);
|
||||||
|
IValue p3 = CreateValue(drawer, parameter3);
|
||||||
|
|
||||||
|
return new ColorValue(p1, p2, p3);
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new Exception("Unknown expected type: " + type.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static IValue CreateValue(Drawer drawer, string value) {
|
public static IValue CreateValue(Drawer drawer, string value) {
|
||||||
value = SettingsAndHelperFunctions.Strip(value);
|
value = SettingsAndHelperFunctions.Strip(value);
|
||||||
if (drawer.CheckVariableExists(value)) return new VariableValue(drawer, value);
|
if (drawer.CheckVariableExists(value)) return new VariableValue(drawer, value);
|
||||||
|
|||||||
Reference in new issue
Block a user