remove most of the crap from queries

This commit is contained in:
Chris Forbes
2011-03-17 21:48:50 +13:00
parent eba7641125
commit 149324ea92
21 changed files with 113 additions and 129 deletions

View File

@@ -93,7 +93,9 @@ namespace OpenRA.Mods.RA
{
if (p == Self.Owner || (p.Stances[Self.Owner] == Stance.Ally && Self.Owner.Stances[p] == Stance.Ally))
{
total += Self.World.Queries.OwnedBy[p].Where(a => a.HasTrait<StrategicPoint>() && a.TraitOrDefault<StrategicPoint>().Critical == critical).Count();
total += Self.World.Queries.WithTrait<StrategicPoint>()
.Where(a => a.Actor.Owner == p)
.Count(a => a.Trait.Critical == critical);
}
}
return total;