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

@@ -91,8 +91,7 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<IRenderable> RenderArmaments(Actor self, AttackBase attack)
{
// Fire ports on garrisonable structures
var garrison = attack as AttackGarrisoned;
if (garrison != null)
if (attack is AttackGarrisoned garrison)
{
var bodyOrientation = coords.Value.QuantizeOrientation(self, self.Orientation);
foreach (var p in garrison.Info.Ports)