Added (Boolean|Integer)Expression subclasses of VariableExpression

This commit is contained in:
atlimit8
2017-04-11 02:52:54 -05:00
parent e73d3922dd
commit b0187dd646
6 changed files with 79 additions and 24 deletions

View File

@@ -398,13 +398,29 @@ namespace OpenRA
return InvalidValueAction(value, fieldType, fieldName);
}
else if (fieldType == typeof(VariableExpression))
else if (fieldType == typeof(BooleanExpression))
{
if (value != null)
{
try
{
return new VariableExpression(value);
return new BooleanExpression(value);
}
catch (InvalidDataException e)
{
throw new YamlException(e.Message);
}
}
return InvalidValueAction(value, fieldType, fieldName);
}
else if (fieldType == typeof(IntegerExpression))
{
if (value != null)
{
try
{
return new IntegerExpression(value);
}
catch (InvalidDataException e)
{