Added CreateValue Method

This commit is contained in:
Lukasz Baldyga committed 2020-11-27 19:44:32 +00:00
1 parent 227580563e
commit 17f3f2aae4
1 file changed
+6
@@ -30,6 +30,12 @@ namespace Advanced_Software_Engineering.Verbs.Value {
} }
} }
public static IValue CreateValue(Drawer drawer, string value) {
value = SettingsAndHelperFunctions.Strip(value);
if (drawer.CheckVariableExists(value)) return new VariableValue(drawer, value);
else return ValueHelper.ConvertToIValue(value);
}
public static IValue CreateValue(bool b) { public static IValue CreateValue(bool b) {
return new BoolValue(b); return new BoolValue(b);
} }