Add ActorsHavingTrait<TTrait>([Func<TTrait, bool])

This commit is contained in:
atlimit8
2015-10-25 04:45:53 -05:00
parent 0997f5b52f
commit b6f17df260
27 changed files with 132 additions and 125 deletions

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Scripting
[Desc("Returns an array of actors representing all ground attack units of this player.")]
public Actor[] GetGroundAttackers()
{
return Player.World.ActorsWithTrait<AttackBase>().Select(a => a.Actor)
return Player.World.ActorsHavingTrait<AttackBase>()
.Where(a => a.Owner == Player && !a.IsDead && a.IsInWorld && a.Info.HasTraitInfo<MobileInfo>())
.ToArray();
}