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

@@ -55,8 +55,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
{
foreach (var sequence in kv.Value.Sequences(image))
{
var s = kv.Value.GetSequence(image, sequence) as FileNotFoundSequence;
if (s == null)
if (!(kv.Value.GetSequence(image, sequence) is FileNotFoundSequence s))
continue;
Console.WriteLine("\tSequence `{0}.{1}` references sprite `{2}` that does not exist.", image, sequence, s.Filename);