make (some) RALint errors nonfatal

This commit is contained in:
Chris Forbes
2010-07-30 08:35:38 +12:00
parent aba9942a85
commit 5d1ee145e1
2 changed files with 11 additions and 2 deletions

View File

@@ -81,6 +81,9 @@ namespace OpenRA
ModAssemblies = asms.ToArray();
}
public static Action<string> MissingTypeAction =
s => { throw new InvalidOperationException("Cannot locate type: {0}".F(s)); };
public static T CreateObject<T>(string classname)
{
foreach (var mod in ModAssemblies)
@@ -91,7 +94,8 @@ namespace OpenRA
return (T)obj;
}
throw new InvalidOperationException("Cannot locate type: {0}".F(classname));
MissingTypeAction(classname);
return default(T);
}
public static Dictionary<string, MapStub> AvailableMaps;