.Any(), .Count() -> .Count or .Length

This commit is contained in:
Eduardo Cáceres
2022-05-02 13:05:22 +02:00
committed by atlimit8
parent 6eb4fe8980
commit 79f321cb44
138 changed files with 233 additions and 258 deletions

View File

@@ -261,7 +261,7 @@ namespace OpenRA.Mods.Common.Traits
if (!IsValidTerrain(self.Location))
return;
if (Info.DeploySounds != null && Info.DeploySounds.Any())
if (Info.DeploySounds != null && Info.DeploySounds.Length > 0)
Game.Sound.Play(SoundType.World, Info.DeploySounds, self.World, self.CenterPosition);
// Revoke condition that is applied while undeployed.
@@ -270,7 +270,7 @@ namespace OpenRA.Mods.Common.Traits
// If there is no animation to play just grant the condition that is used while deployed.
// Alternatively, play the deploy animation and then grant the condition.
if (!notify.Any())
if (notify.Length == 0)
OnDeployCompleted();
else
foreach (var n in notify)
@@ -285,7 +285,7 @@ namespace OpenRA.Mods.Common.Traits
if (!init && deployState != DeployState.Deployed)
return;
if (Info.UndeploySounds != null && Info.UndeploySounds.Any())
if (Info.UndeploySounds != null && Info.UndeploySounds.Length > 0)
Game.Sound.Play(SoundType.World, Info.UndeploySounds, self.World, self.CenterPosition);
if (!init)
@@ -293,7 +293,7 @@ namespace OpenRA.Mods.Common.Traits
// If there is no animation to play just grant the condition that is used while undeployed.
// Alternatively, play the undeploy animation and then grant the condition.
if (!notify.Any())
if (notify.Length == 0)
OnUndeployCompleted();
else
foreach (var n in notify)