Use pattern matching

This commit is contained in:
Eduardo Cáceres
2022-05-02 13:11:49 +02:00
committed by atlimit8
parent aed2b8afae
commit 2677e9c013
15 changed files with 83 additions and 90 deletions

View File

@@ -177,8 +177,7 @@ namespace OpenRA.Graphics
foreach (var e in World.Effects)
{
var ea = e as IEffectAboveShroud;
if (ea == null)
if (!(e is IEffectAboveShroud ea))
continue;
foreach (var renderable in ea.RenderAboveShroud(this))
@@ -219,8 +218,7 @@ namespace OpenRA.Graphics
foreach (var e in World.Effects)
{
var ea = e as IEffectAnnotation;
if (ea == null)
if (!(e is IEffectAnnotation ea))
continue;
foreach (var renderAnnotation in ea.RenderAnnotation(this))