bug #997 -- introduce generic version of FieldLoader.GetValue

This commit is contained in:
Chris Forbes
2011-07-08 21:52:33 +12:00
committed by Paul Chote
parent 7e162ad744
commit 847a248a26

View File

@@ -90,6 +90,11 @@ namespace OpenRA.FileFormats
UnknownFieldAction( key.Trim(), self.GetType() );
}
public static T GetValue<T>( string field, string value )
{
return (T) GetValue( field, typeof(T), value );
}
public static object GetValue( string field, Type fieldType, string x )
{
if (x != null) x = x.Trim();