Change to use pattern matching

This commit is contained in:
teinarss
2021-02-28 19:00:32 +01:00
committed by reaperrr
parent 7c0e4b25ae
commit d60c05eff3
35 changed files with 63 additions and 122 deletions

View File

@@ -102,12 +102,8 @@ namespace OpenRA.Mods.Common
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
var reference = value as ActorInitActorReference;
if (reference != null)
return reference.InternalName;
}
if (destinationType == typeof(string) && value is ActorInitActorReference reference)
return reference.InternalName;
return base.ConvertTo(context, culture, value, destinationType);
}