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

@@ -183,19 +183,19 @@ namespace OpenRA.Mods.Cnc.Traits
public override string IconOverlayTextOverride()
{
var info = Info as GrantPrerequisiteChargeDrainPowerInfo;
if (info == null || !Active)
if (!Active)
return null;
var info = (GrantPrerequisiteChargeDrainPowerInfo)Info;
return active ? info.ActiveText : available ? info.AvailableText : null;
}
public override string TooltipTimeTextOverride()
{
var info = Info as GrantPrerequisiteChargeDrainPowerInfo;
if (info == null || !Active)
if (!Active)
return null;
var info = (GrantPrerequisiteChargeDrainPowerInfo)Info;
return active ? info.ActiveText : available ? info.AvailableText : null;
}
}