Remove explicit List<Actors> everywhere.
This commit is contained in:
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.AI
|
||||
{
|
||||
protected const int missileUnitsMultiplier = 3;
|
||||
|
||||
protected static int CountAntiAirUnits(List<Actor> units)
|
||||
protected static int CountAntiAirUnits(IEnumerable<Actor> units)
|
||||
{
|
||||
int missileUnitsCount = 0;
|
||||
foreach (var unit in units)
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.RA.AI
|
||||
return base.MayBeFlee(owner, (enemyAroundUnit) =>
|
||||
{
|
||||
int missileUnitsCount = 0;
|
||||
if (enemyAroundUnit.Count > 0)
|
||||
if (enemyAroundUnit.Any())
|
||||
missileUnitsCount = CountAntiAirUnits(enemyAroundUnit);
|
||||
|
||||
if (missileUnitsCount * missileUnitsMultiplier > owner.units.Count)
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenRA.Mods.RA.AI
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual bool MayBeFlee(Squad squad, Func<List<Actor>, bool> flee)
|
||||
protected virtual bool MayBeFlee(Squad squad, Func<IEnumerable<Actor>, bool> flee)
|
||||
{
|
||||
if (!squad.IsValid)
|
||||
return false;
|
||||
@@ -107,7 +107,7 @@ namespace OpenRA.Mods.RA.AI
|
||||
if (!enemyAroundUnit.Any())
|
||||
return false;
|
||||
|
||||
return flee(enemyAroundUnit.ToList());
|
||||
return flee(enemyAroundUnit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user