Fix IDE0039

This commit is contained in:
RoosterDragon
2023-02-19 11:56:54 +00:00
committed by abcdefg30
parent 4b3f7034b2
commit d4135d608e
67 changed files with 498 additions and 505 deletions

View File

@@ -9,7 +9,6 @@
*/
#endregion
using System;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Primitives;
@@ -93,16 +92,16 @@ namespace OpenRA.Mods.D2k.Traits
return;
}
Func<Actor, bool> isValidTarget = a =>
bool IsValidTarget(Actor a)
{
if (!a.Info.HasTraitInfo<AttractsWormsInfo>())
return false;
return mobile.CanEnterCell(a.Location, null, BlockedByActor.None);
};
}
var actorsInRange = self.World.FindActorsInCircle(self.CenterPosition, WormInfo.MaxSearchRadius)
.Where(isValidTarget).SelectMany(a => a.TraitsImplementing<AttractsWorms>());
.Where(IsValidTarget).SelectMany(a => a.TraitsImplementing<AttractsWorms>());
var noiseDirection = actorsInRange.Aggregate(WVec.Zero, (a, b) => a + b.AttractionAtPosition(self.CenterPosition));