Add FieldLoader and linter support for BooleanExpression.

This commit is contained in:
Paul Chote
2016-11-13 15:10:39 +00:00
parent 23f4ae5027
commit 1cc7944437
3 changed files with 28 additions and 1 deletions

View File

@@ -15,12 +15,14 @@ using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using OpenRA.Graphics;
using OpenRA.Primitives;
using OpenRA.Support;
namespace OpenRA
{
@@ -396,6 +398,22 @@ namespace OpenRA
return InvalidValueAction(value, fieldType, fieldName);
}
else if (fieldType == typeof(BooleanExpression))
{
if (value != null)
{
try
{
return new BooleanExpression(value);
}
catch (InvalidDataException e)
{
throw new YamlException(e.Message);
}
}
return InvalidValueAction(value, fieldType, fieldName);
}
else if (fieldType.IsEnum)
{
try